Repository navigation
fix(forms): record authored form version on observations - #1046
Merged
najuna-brian merged 6 commits intoNov 18, 2026
Merged
najuna-brian merged 6 commits into
najuna-brian merged 6 commits into
Conversation
Contributor
Author
|
Hello @najuna-brian i have solved this issue, could you please review when you get a minute |
Member
|
Thanks @Grace256c , great work! One follow-up idea: trim whitespace in the TS version helpers so they match Desktop’s Rust form_version. |
najuna-brian
left a comment
Member
There was a problem hiding this comment.
- Whitespace handling differs between TS and Rust. The three TS resolvers return the authored string untrimmed (" 2.0 " stays " 2.0 "), and the docs now say "preserved exactly as written". Desktop's Rust form_version (desktop/src-tauri/src/local_api/forms.rs:89, already on dev) trims. So the same form can be "2.0" in the Desktop API and " 2.0 " on observations. Simplest fix: trim in the TS resolvers and drop that docs sentence.
najuna-brian
approved these changes
Nov 18, 2026
Member
|
Thanks @Grace256c |
Member
|
Thanks @Grace256c, great work! I tested this on an Android emulator. A new observation from a form with "version": "3" saved as 3, a form with no version saved as 1.0, and editing the v3 observation kept it at 3. The whitespace trim looks good too. |
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
New observations were not consistently recording the authored version of the form used to create them. Formulus could still persist
"1.0"regardless of the opened schema, Desktop preview did not consistently preserve the session version, and Formplayer drafts/sticky values only considered the legacyversionfield.This change carries the authored form version through the full observation workflow using the same resolution established in #909:
schemaVersionversion"1.0"Formulus
FormSpec.schemaVersionwhen a Formplayer session opens."2"still records"2"even if the available form spec changes before submission.formVersionis preserved.No Formulus bridge contract or interface version changes were required.
Formplayer
schemaVersion → version → "1.0"resolution for:Versionless sticky data now uses the resolved
"1.0"bucket. Existing legacy::0sticky values are intentionally left untouched; no migration is included.Desktop
formVersionand other observation extras during edits."1.0".No Rust persistence or public preview bridge changes were required.
Documentation
Updates the Form Versioning reference to document:
schemaVersionprecedenceversionsupport"1.0"fallbackformVersionwhen editingType of Change
Component(s) Changed
Testing
Coverage includes:
schemaVersionversion"1.0"fallbackVerification after rebasing onto the merged #909:
Formulus
pnpm run lintpnpm run format:checkpnpm run test --ci --watchAll=falseFormplayer
Desktop
pnpm run lintpnpm run format:checkpnpm testpnpm typecheckpnpm run buildDocumentation
pnpm run validateRepository
git diff --check upstream/dev...HEADKnown non-blocking warnings remain in existing test/build infrastructure, including Jest teardown warnings, jsdom canvas limitations, Desktop bundle-size warnings, and existing documentation link warnings.
During earlier verification,
attachmentManifestResume.test.tsfailed once on cursor advancement and then passed on rerun; repeated focused runs also passed, and no causal connection to this change was found.Checklist
Closes #123Closes #950