Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace old draft with a new one atomically #6052

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

link2xt
Copy link
Collaborator

@link2xt link2xt commented Oct 16, 2024

This prevents creation of multiple drafts per chat.

Fixes #6036

This prevents creation of multiple drafts per chat.
Copy link
Contributor

@WofWca WofWca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

}
futures::future::join_all(tasks.into_iter()).await;

assert!(chat_id.get_draft(&t).await?.is_some());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I tried assert_eq!(chat_id.get_draft(&t).await?.unwrap().text, "1000");, but it sometimes fails.
I think it would make sense to also ensure that the last set_draft prevails, but I guess this is a separate issue.

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.

It's possible to have several drafts per one chat
2 participants