nio-bot icon indicating copy to clipboard operation
nio-bot copied to clipboard

[BUG] Rooms are missing information (like users), other missing data

Open nexy7574 opened this issue 4 months ago • 0 comments

Describe the bug Some data, such as room name, member list, and power levels are absent when the bot starts for a subsequent time after the first startup

To Reproduce

  1. create a niobot
  2. start that bot
  3. query some room information, see that it is populated
  4. stop that bot
  5. start it again
  6. query the room information again, see that it is no longer populated
  7. viola

Expected behavior The room information should remain populated

Additional context The cause for this is that sync data is not stored, only the sync token. When the bot is started again, it resumes from where it left off, however, it has not stored the data that it had previously. The reason for the unpopulated room data is this room data is not being re-received from sync calls, as the homeserver thinks it is not useful data, but we are lacking it.

There is a workaround that has been added to NioBot v1.2.0 beta, which is force_initial_sync, which forces the bot to not resume. However, for large accounts with lots of rooms and history, this can cause startup times to skyrocket to many many minutes.

I have attempted to remedy this in my own bot with a few tricks, however I cannot get the state to be reliably stored and then restored from a database, as there is sometimes a mystery validation error. I am waiting for matrix-nio#506 to be finished & merged so that I can properly debug why these syncs that are valid going into the database, are not valid coming out of the database

At this time, force_initial_sync is the only solution to this problem.

nexy7574 avatar Oct 13 '24 10:10 nexy7574