Skip to content

canInvite is now depending of onboarding-reserve-status pending request#1162

Merged
jordividaller merged 1 commit into
mainfrom
fix/pbyr-4295-disable-invite-button-when-request-pending
Jul 16, 2026
Merged

canInvite is now depending of onboarding-reserve-status pending request#1162
jordividaller merged 1 commit into
mainfrom
fix/pbyr-4295-disable-invite-button-when-request-pending

Conversation

@jordividaller

@jordividaller jordividaller commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

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-status pending 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-status to 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-status finished.

useEmploymentOnboardingReservesStatus now exposes isLoading, wired through getLoadingStates as isLoadingOnboardingReservesStatus. canInvite stays false while that request is pending (along with existing employment status and pre-onboarding checks), which keeps the invite control disabled via OnboardingInvite until reserves status is known.

Reviewed by Cursor Bugbot for commit 74fc952. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 226.62 kB 226.6 kB +19 B (+0.0%) 🔴
Total (raw) 612.7 kB 612.61 kB +93 B (+0.0%) 🔴
CSS (gzip) 21.45 kB 21.45 kB 0 B (0%) 🟢
CSS (raw) 110.5 kB 110.5 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 226.62 kB / 250 kB (90.6%)
  • ✅ Total raw: 612.7 kB / 650 kB (94.3%)
  • ✅ CSS gzipped: 21.45 kB / 25 kB (85.8%)

Largest Files (Top 5)

  1. chunk-Y3CJRZLA.js - 14 kB (0 B (0%))
  2. styles.css - 10.73 kB (0 B (0%))
  3. index.css - 10.73 kB (0 B (0%))
  4. chunk-Q5OFEWTH.js - 6.43 kB (0 B (0%))
  5. index.js - 6.34 kB (0 B (0%))
View All Files (345 total)
File Size (gzip) Change
chunk-Y3CJRZLA.js 14 kB 0 B (0%)
styles.css 10.73 kB 0 B (0%)
index.css 10.73 kB 0 B (0%)
chunk-Q5OFEWTH.js 6.43 kB 0 B (0%)
index.js 6.34 kB 0 B (0%)
chunk-BYDNNJHZ.js 6.08 kB 0 B (0%)
chunk-G2LZFGZA.js 5.31 kB 0 B (0%)
chunk-3HMUXWNW.js 4.86 kB 0 B (0%)
chunk-A5SRPVT2.js 4.76 kB 0 B (0%)
chunk-S4QKVG2B.js 3.89 kB 0 B (0%)

✅ Bundle size check passed

@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage Report

⚪ Coverage unchanged

Metric Current Previous Change Status
Lines 88.46% 88.46% 0%
Statements 87.87% 87.87% 0%
Functions 84.84% 84.84% 0%
Branches 79.86% 79.86% 0%

Detailed Breakdown

Lines Coverage
  • Covered: 3885 / 4392
  • Coverage: 88.46%
  • Change: 0% (0 lines)
Statements Coverage
  • Covered: 3947 / 4492
  • Coverage: 87.87%
  • Change: 0% (0 statements)
Functions Coverage
  • Covered: 1052 / 1240
  • Coverage: 84.84%
  • Change: 0% (0 functions)
Branches Coverage
  • Covered: 2443 / 3059
  • Coverage: 79.86%
  • Change: 0% (1 branches)

✅ Coverage check passed

@github-actions

Copy link
Copy Markdown
Contributor

Deploy preview for adp-cost-calculator ready!

Project:adp-cost-calculator
Status: ✅  Deploy successful!
Preview URL:https://adp-cost-calculator-8e541dn9h-remotecom.vercel.app
Latest Commit:74fc952

Deployed with vercel-action

@github-actions

Copy link
Copy Markdown
Contributor

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-4hc6wbth2-remotecom.vercel.app
Latest Commit:74fc952

Deployed with vercel-action

@jordividaller jordividaller merged commit b42424c into main Jul 16, 2026
11 checks passed
@jordividaller jordividaller deleted the fix/pbyr-4295-disable-invite-button-when-request-pending branch July 16, 2026 08:46
@jordividaller jordividaller restored the fix/pbyr-4295-disable-invite-button-when-request-pending branch July 16, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants