You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Quit: hold the quit while a send runs, so text typed during a slow send is saved #206
A normal quit or a window close waits up to 1.5 s for the window to save its drafts (FLUSH_WAIT in src-tauri/src/studio/quit.rs). The window first waits for each send on its way, then saves each changed screen. During a send, the window does not save the screen it is sending from. If that save ran, the screen's draft would have two owners: the send, and the save.
So if a send takes longer than 1.5 s, text the person typed during it is lost when the quit goes through. A send normally ends in milliseconds. It runs longer only when copying large pictures, or while it waits for the update pass.
#201 ships with this as a known limit. A fix that saved during the send was tried in 964383e and reverted. It kept one draft under two screens, and it brought a sent picture back after a relaunch (#205).
Fix
Rust holds a quit for as long as a send runs, then gives the window its 1.5 s to save. The window would tell Rust when a send starts and ends, and the quit hold in quit.rs would wait on that before its timer starts. Keep a ceiling, so a hung send cannot block a quit forever.
Test
A window test with a held send, text typed during it, and a quit. The text is saved once, under its own screen, after the send answers. A Rust test checks that the hold waits for a send in flight and still ends at its ceiling.
Register each send with Rust before asynchronous send work begins, and release it on every success or failure path. Coordinate registration with quit so a send cannot slip between the idle check and the flush; handle overlapping sends and a missing window without leaving quit blocked.
Hold close and quit until registered sends finish or a bounded ceiling expires, then request the existing flush and allow its full 1.5 s. Preserve the existing shared handling of repeated close and quit requests. Do not save the sending screen concurrently with its send.
Add a window regression test for a held send and edits made during it, checking that the later draft is saved once under the right screen without resurrecting sent pictures. Add Rust tests for send completion, the ceiling, registration races, and repeated quit requests. Document that a send exceeding the ceiling can still lose unsaved edits.
Activity
pullfrog commentedon Nov 8, 2026
Implementation plan
QuitFlush::holdcurrently emitsstudio://flushand starts the 1.5 s timeout immediately. Studio drafts: one owner for the draft and the outgoing message #205 is related but explicitly excludes the quit wait; it is not a duplicate.gpt-6.1-terra| 𝕏fix(studio): the cleanup keeps a cut-off first send's pictures, and a…
fix(studio): a send takes what was clicked, a quit loses no draft, an…