Skip to content

Race condition with group editor bot #6408

Closed
@link2xt

Description

@link2xt

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.

Metadata

Metadata

Assignees

Labels

bugSomething is not working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions