Skip to content

fix: ChatId::maybe_delete_draft: Don't delete message if it's not a draft anymore (#6053) - #6061

Merged
iequidoo merged 1 commit into
mainfrom
iequidoo/maybe_delete_draft-race
Oct 19, 2024
Merged

fix: ChatId::maybe_delete_draft: Don't delete message if it's not a draft anymore (#6053)#6061
iequidoo merged 1 commit into
mainfrom
iequidoo/maybe_delete_draft-race

Conversation

@iequidoo

@iequidoo iequidoo commented Oct 17, 2024

Copy link
Copy Markdown
Collaborator

Fix #6053
Follow-up to 07fa9c3

@iequidoo
iequidoo force-pushed the iequidoo/maybe_delete_draft-race branch from 8767976 to 17610e4 Compare October 18, 2024 15:12
@iequidoo

Copy link
Copy Markdown
Collaborator Author

Added FOREIGN KEY(msg_id) to msgs_status_updates, otherwise webxdc drafts aren't deleted properly. As for the smtp and msgs_mdns tables, no foreign keys are needed there because drafts are not yet sent

@iequidoo
iequidoo requested a review from link2xt October 18, 2024 15:16
@iequidoo
iequidoo marked this pull request as ready for review October 18, 2024 15:16
Comment thread src/message.rs
@iequidoo
iequidoo force-pushed the iequidoo/maybe_delete_draft-race branch from 17610e4 to 2e6cc57 Compare October 19, 2024 14:16
@iequidoo
iequidoo merged commit df4fd82 into main Oct 19, 2024
@iequidoo
iequidoo deleted the iequidoo/maybe_delete_draft-race branch October 19, 2024 14:48
WofWca added a commit that referenced this pull request Jul 30, 2026
The issue has been introduced in
cf33db3
(#2887).

This, again, has to do with a race where the draft message
is sent in another Future after `get_draft` but before `sql.execute`.

Related:
- 07fa9c3
  (#6052).
- df4fd82
  (#6061).
WofWca added a commit that referenced this pull request Aug 2, 2026
The issue has been introduced in
cf33db3
(#2887).

This, again, has to do with a race where the draft message
is sent in another Future after `get_draft` but before `sql.execute`.

Related:
- 07fa9c3
  (#6052).
- df4fd82
  (#6061).
WofWca added a commit that referenced this pull request Aug 2, 2026
The issue has been introduced in
cf33db3
(#2887).

This, again, has to do with a race where the draft message
is sent in another Future after `get_draft` but before `sql.execute`.

Related:
- 07fa9c3
  (#6052).
- df4fd82
  (#6061).
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.

maybe_delete_draft() might delete a "real" message due to a race

2 participants