Skip to content

fix(onboarding): skip legacy contract details schema fetch for jsf v1 countries - #1419

Merged
gabrielseco merged 1 commit into
mainfrom
fix/onboarding-skip-v0-contract-details-fetch
Sep 29, 2026
Merged

gabrielseco merged 1 commit into
mainfrom
fix/onboarding-skip-v0-contract-details-fetch

Conversation

@gabrielseco

@gabrielseco gabrielseco commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Onboarding no longer requests the contract details form twice for countries on the newer schema format when resuming an existing employment.

Why

For those countries, the legacy form request still fired whenever an employment already existed, and its result was thrown away. That's a wasted network round-trip on every contract details load.

What changed

Toggle details
  • src/flows/Onboarding/hooks.tsx: the legacy useJSONSchema({ form: 'contract_details' }) query is now gated on isContractDetailsEnabled && !isJsfV1ContractDetailsEnabled.
  • isContractDetailsEnabled already excluded jsf v1 countries on the contract_details step, but its || Boolean(employmentId) branch re-enabled the query for them once an employment existed. stepFields, initial values and submit already read from the v1 form when isJsfV1ContractDetailsEnabled is true, so the v0 data was unused.
  • No public API change.

Screenshots

N/A

Related Resources

Testing

  • Resume an onboarding for a jsf v1 country (e.g. Germany) in example/ and confirm only one contract details schema request in the network tab
  • Feature flag: N/A

🤖 Generated with Claude Code


Note

Low Risk
Single conditional on an internal query flag; behavior for non–v1 countries is unchanged and v1 paths were already authoritative.

Overview
Stops the legacy contract_details JSON schema query from running when JSF v1 contract details are active, so onboarding no longer fires two schema requests for the same step.

The legacy useJSONSchema hook’s queryOptions.enabled now requires isContractDetailsEnabled && !isJsfV1ContractDetailsEnabled. Resuming an existing employment used to turn on the legacy fetch via the employmentId branch of isContractDetailsEnabled even for v1 countries, while fields, initial values, and submit already used the v1 form—so the v0 response was unused.

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

… countries

When an employment id is present, isContractDetailsEnabled is true regardless
of the country's schema version, so jsf v1 countries fetched contract_details
twice: once through the v0 useJSONSchema path (result unused) and once through
useJsfV1ContractDetails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 167.25 kB 167.25 kB -1 B (-0.0%) 🟢
Total (raw) 559.22 kB 559.22 kB +4 B (+0.0%) 🔴
CSS (gzip) 21.94 kB 21.94 kB 0 B (0%) 🟢
CSS (raw) 114.43 kB 114.43 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 167.25 kB / 350 kB (47.8%)
  • ✅ Total raw: 559.22 kB / 850 kB (65.8%)
  • ✅ CSS gzipped: 21.94 kB / 25 kB (87.8%)

Largest Files (Top 5)

  1. CheckBoxField-CBXcXbix.js - 24.61 kB (0 B (0%))
  2. ContractorOnboarding-CZBU8CGm.js - 13.54 kB (0 B (0%))
  3. Onboarding-BsgnKiE2.js - 11.27 kB (new)
  4. Termination-zUqQ758Y.js - 11.08 kB (0 B (0%))
  5. styles.css - 10.97 kB (0 B (0%))
View All Files (75 total)
File Size (gzip) Change
CheckBoxField-CBXcXbix.js 24.61 kB 0 B (0%)
ContractorOnboarding-CZBU8CGm.js 13.54 kB 0 B (0%)
Onboarding-BsgnKiE2.js 11.27 kB new
Termination-zUqQ758Y.js 11.08 kB 0 B (0%)
styles.css 10.97 kB 0 B (0%)
index.css 10.97 kB 0 B (0%)
CostCalculator-DKTQMrVy.js 10.68 kB 0 B (0%)
internals-CjKQthVT.js 8.23 kB 0 B (0%)
index.js 5.04 kB -4 B (-0.1%)
JSONSchemaForm-I1mWdIp7.js 4.92 kB 0 B (0%)

✅ Bundle size 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-b474bz5s0-remotecom.vercel.app
Latest Commit:d97fc09

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-61qd0mcb7-remotecom.vercel.app
Latest Commit:d97fc09

Deployed with vercel-action

@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage Report

✅ Coverage increased! 🎉

Metric Current Previous Change Status
Lines 86.36% 86.36% 0% ⚪
Statements 85.93% 85.93% 0% ⚪
Functions 84.92% 84.92% 0% ⚪
Branches 77.80% 77.79% +0.01% 🟢

Detailed Breakdown

Lines Coverage
  • Covered: 4850 / 5616
  • Coverage: 86.36%
  • Change: 0% (0 lines)
Statements Coverage
  • Covered: 4934 / 5742
  • Coverage: 85.93%
  • Change: 0% (0 statements)
Functions Coverage
  • Covered: 1290 / 1519
  • Coverage: 84.92%
  • Change: 0% (0 functions)
Branches Coverage
  • Covered: 3004 / 3861
  • Coverage: 77.80%
  • Change: +0.01% (2 branches)

✅ Coverage check passed

@gabrielseco
gabrielseco merged commit 23d8090 into main Sep 29, 2026
14 checks passed
@gabrielseco
gabrielseco deleted the fix/onboarding-skip-v0-contract-details-fetch branch September 29, 2026 10:11
@gabrielseco gabrielseco mentioned this pull request Sep 30, 2026
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