Repository navigation
feat(api): persist shared-context following across devices - #1812
Open
LiranCohen wants to merge 11 commits into
Open
LiranCohen wants to merge 11 commits into
LiranCohen wants to merge 11 commits into
Conversation
|
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.



Shared contexts currently survive only in one agent's local storage, forcing dapps to maintain synchronized bookmark records and reconciliation loops. Make
contexts.follow()and invitation acceptance save encrypted recipient-owned choices, and restore them through the existing context APIs after verifying current membership and keys.defineProtocol()adds the private, immutableenboxContextFollowjournal alongside the managed invitation inbox. One internal module defines both paths with separate access rules. Follow decisions contain owner DID, context ID, and a declared role-group name; forget decisions need only the coordinates andfollowing: false. The latest signed timestamp and record ID win. A newer choice remains authoritative even when the current app cannot execute its group.contexts.forget({ ownerDid, id })can clear a choice without a live acceptance, including after revocation or on a fresh device. Handle-level forgetting stays fenced to its exact acceptance.leave()withdraws the owner role before saving the forget; these writes are not atomic, and coordinate-based forgetting can complete the saved choice after a partial failure. Retired leave/follow operations exposeContextRetiredError.Observation restores choices in the background without blocking known contexts. Recipient sync and matching owner-context recovery events retry unavailable choices; ordinary owner currentness probes do not trigger retries. Superseded follows cannot return a conflicting role policy. Rollback re-verifies the current saved choice instead of reinstalling captured authority. Per-owner restoration failures retain choices and available contexts, with unexpected failures logged.
Protocol-write delegates act for the identity and can change its shared choices; remote access is always verified independently. Permissions are not widened. The docs describe one-shot list latency, partial leave recovery, and retained journal history. No migration, local-only fallback, outbox, or additional polling timer is introduced.
The paired Notesd adoption #152 removes its bookmark controller, schema, store property, startup wiring, and redundant tests: 362 production lines and 498 test lines. Notesd keeps its sharing presentation and CRDT repair policy. It remains a draft until the SDK is published and its dependencies are pinned.