Skip to content

fix: get_draft possibly returning non-draft msg - #8532

Open
WofWca wants to merge 1 commit into
mainfrom
wofwca/fix-get-draft-race
Open

fix: get_draft possibly returning non-draft msg#8532
WofWca wants to merge 1 commit into
mainfrom
wofwca/fix-get-draft-race

Conversation

@WofWca

@WofWca WofWca commented Aug 2, 2026

Copy link
Copy Markdown
Member

Due to a gap between get_draft_msg_id() and Message::load_from_db.
Possibly can happen if the draft gets sent
while get_draft() is in progress.

Solved by doing both queries in a transaction.

@WofWca
WofWca force-pushed the wofwca/fix-get-draft-race branch from 2bda9b7 to a19ac2f Compare August 2, 2026 16:03
@WofWca
WofWca changed the base branch from wofwca/keep-draft-id-stuff to main August 2, 2026 16:03
@WofWca
WofWca force-pushed the wofwca/fix-get-draft-race branch 5 times, most recently from d9cae15 to 8de62f2 Compare August 2, 2026 16:25
@WofWca
WofWca marked this pull request as ready for review August 2, 2026 16:28
@WofWca
WofWca force-pushed the wofwca/fix-get-draft-race branch from 8de62f2 to ab6dbe0 Compare August 2, 2026 19:10
Due to a gap between `get_draft_msg_id()` and `Message::load_from_db`.
Possibly can happen if the draft gets sent
while `get_draft()` is in progress.

Solved by doing both queries in a transaction.
@WofWca
WofWca force-pushed the wofwca/fix-get-draft-race branch from ab6dbe0 to c1a8fc5 Compare August 2, 2026 19:31
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