Fix bugged room state from lingering connection

When disconnecting from a room whose instance is "waiting" and then
reconnecting, the old instance would not be stopped immediately.
Instead, it would continue to run until it managed to reconnect, sending
status updates to the main event bus in the process.

These events led to the euph::Room entering a state where it was
connected but no last_msg_id was set. This meant that no new messages
could be entered into the vault, including messages sent by the user.
The result was UI weirdness when sending a message.

As a fix, euphoxide instances are now identified via an u32 id. This id
is unique across all rooms. Packets by unknown ids are rejected and have
no effect on room states.
This commit is contained in:
Joscha 2023-02-17 17:29:12 +01:00
parent d74282581c
commit 293112777a
5 changed files with 87 additions and 44 deletions

View file

@ -35,7 +35,7 @@ features = ["rustls-tls-native-roots"]
[dependencies.euphoxide]
git = "https://github.com/Garmelon/euphoxide.git"
tag = "v0.3.0"
rev = "069e4e02c77e5bc649cd770af8183d8be8cd52f5"
features = ["bot"]
# [patch."https://github.com/Garmelon/euphoxide.git"]