Skip to content

fix(yjs): let the server grant stale recovery to one client - #3433

Merged
JammingBen merged 2 commits into
mainfrom
fix/yjs-recovery-grant
Sep 30, 2026
Merged

JammingBen merged 2 commits into
mainfrom
fix/yjs-recovery-grant

Conversation

@JammingBen

@JammingBen JammingBen commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Replaces the client-side recoveryClientId election and its 150 ms wait with a per-etag grant from the Yjs server. Just like with the seeding, letting the server decide who can recover is more robust than handling this client-side. The meta observer now uses transaction.local instead of own-origin constants.

The client still uses the old seeding grant to ensure backwards compatibility. We plan to remove it eventually, see #3436. The same goes for the old recovery mechanism, which is also kept in the client. Most of this should be encapsulated in 86512ec.

fixes #3429
fixes #3132
refs #3428

Replaces the recoveryClientId election and its 150 ms wait with a
per-etag grant from the Yjs server, generalized from the seed grant.
The meta observer now uses transaction.local instead of own-origin
constants.
@JammingBen
JammingBen force-pushed the fix/yjs-recovery-grant branch from 86512ec to 42806d5 Compare September 30, 2026 06:32
@JammingBen
JammingBen force-pushed the fix/yjs-recovery-grant branch from 42806d5 to 8cf4d25 Compare September 30, 2026 06:54
@JammingBen
JammingBen marked this pull request as ready for review September 30, 2026 07:24
@JammingBen
JammingBen merged commit 49f5346 into main Sep 30, 2026
31 checks passed
@JammingBen
JammingBen deleted the fix/yjs-recovery-grant branch September 30, 2026 08:49
@openclouders openclouders mentioned this pull request Sep 30, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[yjs] Concurrent recovery can duplicate document A yjs session joiner with a new etag can't always claim recovery

2 participants