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

Race condition with group editor bot #6408

Open
link2xt opened this issue Jan 4, 2025 · 1 comment
Open

Race condition with group editor bot #6408

link2xt opened this issue Jan 4, 2025 · 1 comment
Assignees
Labels
bug Something is not working

Comments

@link2xt
Copy link
Collaborator

link2xt commented Jan 4, 2025

There is a race condition between finishing joining verified group and receiving messages from other members. It is frequently visible with the Group Editor Bot. Group editor bot sends a new WebXDC editor to the chat when someone uses /editor command and keeps resending it every time someone joins. However, sometimes new member (Bob) joining via invite link from Alice receives an editor after marking the group as verified (receiving some message with Chat-Verified header) but before receiving the "member added" message. In this case Bob receives editor before fully joining the group and replaces editor with an error saying something about the message being sent by non-verified member, so Bob cannot use the editor afterwards.

This issue should be reproducible with a Rust test.

The solution would be to only mark the group as verified after receiving "Member added" message which introduces editor bot key. In this case editor will appear before the green checkmark and from a non-member, but should still be usable.

@link2xt link2xt added the bug Something is not working label Jan 4, 2025
@Septias Septias self-assigned this Jan 5, 2025
@Septias
Copy link
Collaborator

Septias commented Jan 6, 2025

Do we actually need to do the secure join or is adding to the group enough? Because the message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

No branches or pull requests

2 participants