Repository navigation
Prevent mailbox refresh failures under load - #315
Merged
Merged
Conversation
huacnlee
marked this pull request as ready for review
September 30, 2026 16:52
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.
Opening several watched mailboxes could reject otherwise valid work in two places: the UI failed the 65th pending RPC immediately, and internal MIME/cache/large-JSON transfers all began at once despite the backend's eight-upload, 128 MiB reservation limits. This fixes #304 and fixes #250 together without increasing either backend limit.
Accepted RPCs now wait in a FIFO behind the existing 64-frame window. Their deadline starts when sent, and a callback that submits more work joins the tail. Queued requests can be cancelled without dispatching them; an already-sent request keeps its slot until its reply or connection failure.
One upload queue belongs to each backend connection and accounts for both declared bytes and slots. Parse, body-cache and large-request uploads share it. A failed or cancelled transfer holds its reservation until discard answers, including when ordinary traffic has filled the RPC window. Unconfirmed discard stops the connection rather than assuming its bytes were released. Disconnect and shutdown settle waiting transfers, and replies from a stopped connection cannot revive them. Cancellation can also withdraw the final domain operation while it is still queued, so staged bytes do not turn into a cancelled write.
The existing byte-string encoding, chunk limits, per-operation size limits and Rust API remain unchanged. No provider HTTP retry policy or unrelated account behavior is changed.
Verification
6e3c367, including standalone backend/app gates and production packaging on Linux, macOS and Windows, native credential contracts, and released/unreleased backend compatibility.git diff --checkpassed.Backend.qmlfunctions andUpload.js; readback matched the uploaded content and every queue/reservation drained. This is now available throughmake test-backend-processbefore its existing Quickshell fixtures. The optional subprocess fixture is Unix-only and refuses Windows before creating storage or starting a backend, because its native known folders cannot be isolated through HOME/XDG overrides.make validateis not fully green locally: its legacy libcurltests/test_imap_ordering.shfixture fails identically on pristineaf8a7ae(the host curl returns the FETCH prefix without its literal body). Rust, JS and portable shell stages passed; the remaining QML/lint stages were run separately. Standalone composition requires missing CMake, and plugin/real-Quickshell validation requires missing Omarchy/Quickshell tools. The new native subprocess test does not substitute for a real Quickshell Process host or a live nine-account mailbox reproduction. This PR remains a draft with those local verification gaps disclosed.Security
PASS for the affected framing, capacity, cancellation and payload-free diagnostic boundaries, based on independent review and the regression tests above. The affected boundary is bounded local RPC/upload scheduling over the existing private stdio connection. No new network, credential, filesystem or executable destination is introduced.
Release Notes