@colibri-social/space-sync 0.7.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,12 +6,15 @@ Keeps a local, up-to-date copy of an atproto permissioned space.
6
6
 
7
7
  `SpaceSyncEngine` runs both:
8
8
 
9
- - **Push.** `registerNotify` subscribes this service on the space host. When a
10
- member writes, their host tells the authority, which forwards to registered
11
- syncers. `notifyWrite(space, repo)` enqueues that repo
12
- - **Sweep.** Every `sweepIntervalMs`, `listRepos` gives the authority's view of
9
+ - **Push.** Every `authorizeSpaceSync` call carries a notify endpoint and a
10
+ per-space token, which registers this service on the space host. The engine
11
+ reauthorizes each space before its credential expires to keep the
12
+ registration alive. When a member writes, their host tells the authority,
13
+ which sends `notifySpaceUpdate` to registered syncers. `notifyWrite(space, repo)`
14
+ enqueues that repo
15
+ - **Sweep.** Every `sweepIntervalMs`, `listWriters` gives the authority's view of
13
16
  the writer set with each repo's revision. Anything ahead of our cursor is
14
- enqueued, and anything that has disappeared is dropped
17
+ enqueued, and anything removed or missing is dropped
15
18
 
16
19
  ## Fail handling
17
20
 
@@ -21,7 +24,8 @@ exponentially to an hour. The sweep skips a repo that is still backing off.
21
24
  | | |
22
25
  | --------------------------------------------------------- | ---------------------------------------- |
23
26
  | the host no longer retains our `since` revision | full recovery from the CAR |
24
- | the account is gone, taken down, suspended or deactivated | drop the repo |
27
+ | the account is taken down, suspended or deactivated | drop the repo |
28
+ | the host has no repo for the account | clear the copy and keep the repo empty |
25
29
  | the set hash disagrees with a verified commit | full recovery |
26
30
  | the authority says the space is deleted | drop the space and forget the credential |
27
31
  | anything else | back off and retry, keeping the copy |