fix: don't reject leaveProject when post-leave sync propagation stalls#1276
Open
gmaclennan wants to merge 3 commits into
Open
fix: don't reject leaveProject when post-leave sync propagation stalls#1276gmaclennan wants to merge 3 commits into
gmaclennan wants to merge 3 commits into
Conversation
leaveProject performs the local leave (assign LEFT + clear data) and then
awaits a trailing waitForSync('initial', { timeoutMs: 45s }) to propagate the
LEFT role to connected peers. That wait was awaited unconditionally, so when a
peer is connected but presync can't complete within 45s — a slow/flaky link, or
the user moving out of range right as they leave — leaveProject rejected with
Error('Sync timeout') even though the device had already left locally. This is
the intermittent "Sync timeout" error users have hit leaving projects.
Make the propagation best-effort: the local leave has already succeeded and the
LEFT role (persisted to the auth namespace) also propagates on the next
connection, so a stalled propagation must not fail the operation.
Adds a regression test (test-e2e/sync-leave-regression.js) plus a controllable
transport test helper (test-e2e/controllable-wire.js) that drives two real
projects over a pause-able wire to deterministically reproduce a connected-but-
stalled peer.
RangerMauve
approved these changes
Jun 8, 2026
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.
leaveProject performs the local leave (assign LEFT + clear data) and then awaits a trailing waitForSync('initial', { timeoutMs: 45s }) to propagate the LEFT role to connected peers. That wait was awaited unconditionally, so when a peer is connected but presync can't complete within 45s — a slow/flaky link, or the user moving out of range right as they leave — leaveProject rejected with Error('Sync timeout') even though the device had already left locally. This is the intermittent "Sync timeout" error users have hit leaving projects.
Make the propagation best-effort: the local leave has already succeeded and the LEFT role (persisted to the auth namespace) also propagates on the next connection, so a stalled propagation must not fail the operation.
Adds a regression test (test-e2e/sync-leave-regression.js) plus a controllable transport test helper (test-e2e/controllable-wire.js) that drives two real projects over a pause-able wire to deterministically reproduce a connected-but- stalled peer.