Update 'Feature: Room State Management'

projectmoon 2020-11-08 20:47:39 +00:00
parent 23f3993bce
commit 6dccbc808e
1 changed files with 1 additions and 1 deletions

@ -10,7 +10,7 @@ Listen to Matrix event for when users enter and leave rooms. This is easily acco
* When the bot joins a room for the first time, member events are fired for every member in the room.
* It seems to sync everything, so you will get a join and leave notification many times, potentially. This is problematic for a few reasons.
* **Solution:** The simple solution in the beginning is to ignore any event more than a few seconds old, and then do a full sync of the users in the room when processing the join event. This works until there's a big network slowdown.
* **Solution:** The simple solution in the beginning is to ignore any event more than a few seconds old, and then do a full sync of the users in the room when processing the join event. This works until there's a big network slowdown, or something else happens. A more reliable solution is to simply track every single event ID in the database, and keep track of when it was processed. If it's in the database, do not process it again.
If the bot is kicked or banned, it does not get events for users leaving a room. Instead, it will get a member event of leaving the room for itself. In that circumstance, it should delete all user information in the database for the room.