fix(sync): guard archive actions by default
This commit is contained in:
@@ -217,15 +217,15 @@ Examples of global-store updates performed in `session-actions.ts`:
|
||||
- `deleteSession()` -> waits for server confirmation or `404`, then removes the session and its persisted state
|
||||
- `moveSessionToDirectory()` -> move the session between directory stores and update the global directory index
|
||||
|
||||
Archive callers whose confirmation spans asynchronous SDK calls may capture the
|
||||
runtime key at operation start and pass it as `expectedRuntimeKey`. The guarded
|
||||
action rechecks that key before every store reconciliation, so a response
|
||||
Archive actions capture the active runtime key when they start and recheck it
|
||||
before every store reconciliation, so a response
|
||||
produced by the previous runtime is rejected instead of mutating the current
|
||||
runtime's live or global session state. A guarded batch stops at the first
|
||||
observed runtime change: sessions the server already confirmed remain archived
|
||||
and stay in `archivedIds`, while every ID not confirmed on the captured runtime
|
||||
is returned in `failedIds` so existing partial-failure feedback stays truthful.
|
||||
Callers that pass no runtime key keep the previous unguarded behavior.
|
||||
Callers whose confirmation can span a runtime switch may pass an
|
||||
`expectedRuntimeKey` captured earlier; ordinary callers are guarded by default.
|
||||
|
||||
## The golden rule
|
||||
|
||||
|
||||
Reference in New Issue
Block a user