docs(development): add a code map for one observation's journey - #947
Open
kingmakeruix wants to merge 1 commit into
Open
kingmakeruix wants to merge 1 commit into
kingmakeruix wants to merge 1 commit into
Conversation
A contributor-facing trail map that follows a single observation from the form on a device to server storage and back out through export, so a newcomer can see where rendering, local persistence, push, server storage and pull/export each happen. - Mermaid sequence diagram of the happy path - a table of the ten steps, each naming the responsible project and linking to the source symbol that implements it - what changes when the device is offline: the write path makes no network call, and "pending" is derived from synced_at/updated_at rather than stored - why attachments are a separate pipeline: observation JSON stores a GUID-shaped basename, binaries move over /api/attachments and are tracked on their own cursor - five existing tests that exercise the path, two of which need PostgreSQL - a short list of what the map deliberately does not cover Every source link was opened and confirmed before writing, and the Mermaid diagram parses cleanly. Refs OpenDataEnsemble#912
5 tasks
Member
|
Please comment on the issue so that it can be assigned to you |
Author
|
@najuna-brian Thanks — done. I have commented on #912 asking to be assigned, with a short summary of what the draft already contains and what I deliberately left out. I will not push anything further to this branch until the issue is assigned to me, so the diff stays as reviewed. |
This branch has not been deployed
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
A contributor-facing code map that follows one observation — a tree measured in the rain — from the form on a device, through local storage and push, into server storage, and back out through pull and export.
New page:
docs/docs/development/observation-journey.md, registered indocs/sidebars.tsnext todevelopment/architecture.It contains:
synced_at/updated_atrather than stored);/api/attachmentsand are tracked on their own cursor);Verification
Every source link was opened and confirmed before it was written, and every symbol named in the table was checked to exist at the cited path. The Mermaid diagram was parsed with the same Mermaid version the docs site uses.
From
docs/, which is exactly what the docs workflow runs:The validator's warnings are all pre-existing anchor warnings in other pages; this page adds none. The page is 619 words excluding code blocks.
One thing I did not resolve
The issue says to ask in the issue when two sources disagree, so I am flagging rather than silently picking a story.
docs/docs/reference/form-specifications.mdL784 states:The Formulus write path cannot currently do that:
PersistObservationInputhasformType,finalData,observationId— no version field.submitObservation(formType, finalData)is positional, also with no version.persistObservationWithAttachmentsL232 callssaveObservation({ formType, data: committedData }).WatermelonDBRepo.saveObservationL225 then storesrecord.formVersion = input.formVersion || '1.0'.So every locally created observation is persisted as
'1.0', while formplayer does know the version — it readsformSchema.versionfor drafts and sticky fields, but never sends it across the bridge. This looks like the same root cause as #909, and I did not want to rewrite that documentation or claim a behaviour the code does not implement, so the page simply states that choosing a form's schema version is a separate question.Closes #912