Skip to content

Resume file uploads across database leader handoffs - #1628

Merged
joepio merged 1 commit into
developfrom
fix/client-db-file-handoff
Sep 22, 2026
Merged

joepio merged 1 commit into
developfrom
fix/client-db-file-handoff

Conversation

@joepio

@joepio joepio commented Sep 22, 2026

Copy link
Copy Markdown
Member

Closing the database leader tab during a file upload left the follower's hash or blob request pending until the 30-second timeout, even after another tab had successfully taken ownership of the database. The staging report surfaced this during profile-picture upload.

Leader announcements now identify their sender. When the uploader or another tab takes over, pending hash/read/blob-store operations can retry once against the new leader. Content-addressed blob writes are safe to repeat after a lost acknowledgement. Other operations fail promptly instead of replaying arbitrary mutations or worker-local session handles. Repeated announcements from the same leader do not replay requests, and legacy announcements remain supported.

Validation: four regression cases failed before the fix; 16 focused Vitest checks now pass, including retry limits, duplicate announcements, cancellation and non-repeatable operations. Library and data-browser TypeScript checks and changed-file lint/format pass. A local Chromium harness exercised all four handoffs using real Web Locks, BroadcastChannel, WASM and OPFS; blobs survived reload.

The exact reported Sentry event was not accessible from this host. This fixes the reproduced handoff failure; a live-but-unresponsive leader that never hands off still has the bounded timeout.

@joepio
joepio merged commit 3a89270 into develop Sep 22, 2026
3 checks passed
@joepio
joepio deleted the fix/client-db-file-handoff branch September 22, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant