You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observations never record the version of the form they were filled in with. Every new observation is stored as form_version = "1.0", whatever the bundle's schema.json says.
#909 makes FormService read the authored version (schemaVersion, then version, then the 1.0 fallback) for display. The persistence path doesn't carry a version at all, as traced in the comments on #909:
formulus/src/webview/FormulusInterfaceDefinition.ts: submitObservation, PersistObservationInput, and FormInitData have no form-version field.
formulus/src/services/attachmentStorage.ts: persistObservationWithAttachments calls deps.saveObservation({ formType, data }) without a version.
ODE Desktop form preview has the same gap (desktop/src/lib/observation.ts defaults to 1.0.0).
Synkronus already stores and returns form_version end to end, so only the clients are wrong.
Why it matters
Analysts need to know which form version produced each record. Without it, they can't tell observations collected before a question or choice list changed from those collected after. We're about to let AI assistants edit forms through ODE Desktop's ode CLI, with bumping the form version as a required step. That is only meaningful once the version is actually recorded.
Edited observations: keep the originally recorded version. updateObservation already leaves formVersion untouched, which matches the documented behaviour ("When editing an observation, the form version used to create it is used").
Bridge: resolve the version on the host side, from the FormSpec that opened the session, instead of trusting a value sent by the WebView. This avoids changing the bridge contract. If the bridge must change after all, bump FORMULUS_INTERFACE_VERSION and run pnpm run sync-interface.
ODE Desktop form preview: persists the same resolved version.
Formplayer: currently reads only formSchema.version for drafts and sticky values. Align it with the same resolution, or document that version is the canonical key.
Done when
A new observation from a form whose schema.json has "version": "3" syncs with form_version = "3", from both Formulus and Desktop preview.
Forms without a version still produce "1.0".
Editing an existing observation keeps its original form_version.
Problem
Observations never record the version of the form they were filled in with. Every new observation is stored as
form_version = "1.0", whatever the bundle'sschema.jsonsays.#909 makes
FormServiceread the authored version (schemaVersion, thenversion, then the1.0fallback) for display. The persistence path doesn't carry a version at all, as traced in the comments on #909:formulus/src/webview/FormulusInterfaceDefinition.ts:submitObservation,PersistObservationInput, andFormInitDatahave no form-version field.formulus/src/services/attachmentStorage.ts:persistObservationWithAttachmentscallsdeps.saveObservation({ formType, data })without a version.formulus/src/database/repositories/WatermelonDBRepo.ts:record.formVersion = input.formVersion || '1.0'therefore always falls back.formulus/src/services/FormService.ts:addNewObservationImplhardcodesformVersion: '1.0'.desktop/src/lib/observation.tsdefaults to1.0.0).Synkronus already stores and returns
form_versionend to end, so only the clients are wrong.Why it matters
Analysts need to know which form version produced each record. Without it, they can't tell observations collected before a question or choice list changed from those collected after. We're about to let AI assistants edit forms through ODE Desktop's
odeCLI, with bumping the form version as a required step. That is only meaningful once the version is actually recorded.Expected behavior
schema.jsonrootschemaVersion, thenversion, then"1.0".updateObservationalready leavesformVersionuntouched, which matches the documented behaviour ("When editing an observation, the form version used to create it is used").FormSpecthat opened the session, instead of trusting a value sent by the WebView. This avoids changing the bridge contract. If the bridge must change after all, bumpFORMULUS_INTERFACE_VERSIONand runpnpm run sync-interface.formSchema.versionfor drafts and sticky values. Align it with the same resolution, or document thatversionis the canonical key.Done when
schema.jsonhas"version": "3"syncs withform_version = "3", from both Formulus and Desktop preview."1.0".form_version.docs/docs/reference/form-specifications.md→ Form Versioning states which key to use and how the version is recorded (see the doc mismatch raised in docs: trace one observation from a form to Synkronus and back #912).Depends on, or should land together with, #909.