Upload cancel/Done race can leave sent files back in the tray #336

Open
opened 2026-11-12 18:25:42 +00:00 by charles · 0 comments
Owner

Found in review of PR #311 (Text chat 12).

CancelUpload removes the job, emits UploadCommand::Cancel and restores the draft (files and text). If the runtime's UploadEvent::Done for that nonce arrives after the cancel (the request had already completed), the message exists on the server and the files are also back in the tray, so the user may send them twice.

Possible fix: remember cancelled nonces until the runtime confirms the cancel, and on a late Done drop the restored files (or accept the message and clear the restored draft). Low priority.

Seen on commit 4705987 (textchat-12-core-uploads).

Found in review of PR #311 (Text chat 12). `CancelUpload` removes the job, emits `UploadCommand::Cancel` and restores the draft (files and text). If the runtime's `UploadEvent::Done` for that nonce arrives after the cancel (the request had already completed), the message exists on the server and the files are also back in the tray, so the user may send them twice. Possible fix: remember cancelled nonces until the runtime confirms the cancel, and on a late `Done` drop the restored files (or accept the message and clear the restored draft). Low priority. Seen on commit 4705987 (`textchat-12-core-uploads`).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#336
No description provided.