canInvite is now depending of onboarding-reserve-status pending request#1162
Merged
jordividaller merged 1 commit intoJul 16, 2026
Merged
Conversation
Contributor
📦 Bundle Size Report
Size Limits
Largest Files (Top 5)
View All Files (345 total)
✅ Bundle size check passed |
Contributor
📊 Coverage Report⚪ Coverage unchanged
Detailed BreakdownLines Coverage
Statements Coverage
Functions Coverage
Branches Coverage
✅ Coverage check passed |
Contributor
|
Deploy preview for adp-cost-calculator ready!
Deployed with vercel-action |
Contributor
|
Deploy preview for remote-flows ready!
Deployed with vercel-action |
gabrielseco
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
it turns out that if GET /companies/:id/employments/:id/onboarding-reserves-status is too slow, we can still click the invite button if we are very fast. I think we should prevent this by disabling the invite button while the API request is pending.
Solution
canInvite is now depending of
GET /companies/:id/employments/:id/onboarding-reserves-statuspending request status. So we cannot click invite until request is finished.How to test
Not easy to test whithout forcing
GET /companies/:id/employments/:id/onboarding-reserves-statusto be slow.You can add code like this to the proxy :
// the invite button disabled-while-loading behavior. Remove before merging. if ( req.method === 'GET' && /\/onboarding-reserves-status(\?|$)/.test(req.originalUrl) ) { await new Promise((resolve) => setTimeout(resolve, 15000)); }And then make a test on an onBoarding, invite button should be disabled during 15seconds while request is finished.
Note
Low Risk
Small onboarding UX guard with no auth or data-model changes; only gates the invite button during an existing API fetch.
Overview
Fixes a race on the review step where users could click Invite before
GET .../onboarding-reserves-statusfinished.useEmploymentOnboardingReservesStatusnow exposesisLoading, wired throughgetLoadingStatesasisLoadingOnboardingReservesStatus.canInvitestays false while that request is pending (along with existing employment status and pre-onboarding checks), which keeps the invite control disabled viaOnboardingInviteuntil reserves status is known.Reviewed by Cursor Bugbot for commit 74fc952. Bugbot is set up for automated code reviews on this repo. Configure here.