Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Document the $sync namespace #17

Merged
merged 3 commits into from
Dec 11, 2023
Merged

feat: Document the $sync namespace #17

merged 3 commits into from
Dec 11, 2023

Conversation

gmaclennan
Copy link
Member

@gmaclennan gmaclennan commented Dec 11, 2023

Adds up-to-date documentation for the $sync namespace. @ErikSin.
Note that this documents the API as-of digidem/comapeo-core#411, so that needs to be merged and released first.
I think this is potentially missing information that might be needed to implement all the screen designs we have: the sync state includes the number of connected peers, but it does not include the number of peers that are syncing the data cores.
I also think we need better vocabulary for talking about the different phases of sync: internally our data is divided into five "namespaces", and each namespace contained different record types:

  • auth namespace contains the role and coreOwnership record types, which establish membership of a project.
  • config namespace contains the deviceInfo, preset, field, icon and projectSettings record types, which is the data needed to start collecting data (we call it "project metadata")
  • blobIndex namespace contains information about all the blobs in the project e.g. filenames and file sizes, like a directory listing.
  • data namespace contains the observation record type (and in the future will contain node, way and track data types).
  • blob namespace contains the raw photo, video and audio data (media data)

We split sync into two parts:

  • initial sync of the auth, config and blobIndex namespaces, which also shares information about how many observations and blobs need to be synced.
  • data sync of the data and blob namespaces.

initial sync happens automatically and in the background whenever a project member connects on the local network. data sync requires user interaction and is started via $sync.start().

@gmaclennan gmaclennan self-assigned this Dec 11, 2023
Copy link

vercel bot commented Dec 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mapeo-core-docs ❌ Failed (Inspect) Dec 11, 2023 4:30pm

Copy link
Member

@achou11 achou11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of small corrections but otherwise lgtm

client-docs/README.md Outdated Show resolved Hide resolved
client-docs/README.md Outdated Show resolved Hide resolved
Co-authored-by: Andrew Chou <andrewchou@fastmail.com>
Co-authored-by: Andrew Chou <andrewchou@fastmail.com>
@gmaclennan gmaclennan merged commit 28e87eb into main Dec 11, 2023
1 of 2 checks passed
@gmaclennan gmaclennan deleted the feat/sync-docs branch December 11, 2023 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants