Repository navigation
fix(onboarding): skip legacy contract details schema fetch for jsf v1 countries - #1419
Merged
Merged
Conversation
… 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>
Contributor
📦 Bundle Size Report
Size Limits
Largest Files (Top 5)
View All Files (75 total)
✅ Bundle size 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 |
Contributor
📊 Coverage Report✅ Coverage increased! 🎉
Detailed BreakdownLines Coverage
Statements Coverage
Functions Coverage
Branches Coverage
✅ Coverage check passed |
2 tasks
jordividaller
approved these changes
Sep 29, 2026
gabrielseco
deleted the
fix/onboarding-skip-v0-contract-details-fetch
branch
September 29, 2026 10:11
Merged
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.
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 legacyuseJSONSchema({ form: 'contract_details' })query is now gated onisContractDetailsEnabled && !isJsfV1ContractDetailsEnabled.isContractDetailsEnabledalready excluded jsf v1 countries on thecontract_detailsstep, 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 whenisJsfV1ContractDetailsEnabledis true, so the v0 data was unused.Screenshots
N/A
Related Resources
Testing
example/and confirm only one contract details schema request in the network tab🤖 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_detailsJSON 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
useJSONSchemahook’squeryOptions.enablednow requiresisContractDetailsEnabled && !isJsfV1ContractDetailsEnabled. Resuming an existing employment used to turn on the legacy fetch via theemploymentIdbranch ofisContractDetailsEnabledeven 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.