Repository navigation
fix(formulus): load authored form schema version - #1045
Merged
najuna-brian merged 1 commit intoNov 12, 2026
Merged
Conversation
Contributor
Author
|
Hello @najuna-brian i have worked on this issue, could you please give review when you get a minute |
najuna-brian
self-requested a review
November 12, 2026 07:15
najuna-brian
approved these changes
Nov 12, 2026
najuna-brian
left a comment
Member
There was a problem hiding this comment.
Thanks Grace, looks good! The precedence matches what we agreed on #909, and the tests are solid. This is good to merge from my side. 🎉
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.
What & Why
Formulus currently assigns every loaded form a hard-coded
schemaVersionof"1.0", even when the form author has provided version metadata inschema.json.This change resolves the authored form version from the root schema using the agreed precedence:
schemaVersionversion"1.0"Blank, whitespace-only, missing, and non-string values fall through to the next valid option. The loaded schema itself is left unchanged.
After
FormServiceloads the form, the resolved value is exposed asFormSpec.schemaVersion. Existing consumers such asFormCardcontinue to read that field through their current behavior, so no separate UI or WebView bridge change is required for #909.This PR is intentionally limited to the FormService metadata-loading behavior covered by #909. Recording that version on newly created observations, along with persistence, Desktop, Formplayer alignment, and the related documentation correction, remains part of #950.
Type of Change
Component(s) Changed
Testing
Added table-driven coverage for:
schemaVersionversionschemaVersionprecedence when both are presentschemaVersionandversionvaluesschemaVersionto validversion"1.0"when neither candidate is validVerification completed from
formulus/:pnpm run lintpnpm run formatpnpm run format:checkpnpm run test --ci --watchAll=falseFormService.test.ts: 34/34 tests passedgit diff --checkJest emits its existing force-exit warning for this test suite. The identical warning was reproduced on unchanged
upstream/dev, confirming it is pre-existing and not introduced by this PR.Checklist
Closes #123Closes #909