MAM synchronization issue (#246)
Andrzej Wójcik (Tigase) opened 5 years ago

Currently, BeagleIM retrieves messages from MAM archive backward (it reads 100 newest messages, then moves to 100 older messages, etc). While this behavior is good as it provides fast synchronization of last messages, it will cause issues when the connection would be broken during message synchronization - older messages would newer be synchronized.

Andrzej Wójcik (Tigase) commented 5 years ago

While the simplest solution would be to change direction and sync from the oldest messages it will not help in all cases as received offline message and the broken connection while the archive is not fully synchronized would still cause issues.

As a solution, I've come up with usage of MAM synchronization ranges stored in the database. When synchronization would be started, then Beagle would record range of synchronization, and after each batch would update the number of synced messages. That would allow us to keep track of synchronized data ranges and allow proper synchronization from the oldest to the newest.

If I'm correct, adding that and then adding some cache for incoming delivery confirmation message could allow us to keep track of synchronization and actually switch to synchronization of ie. last day of newest messages and then switching to synchronization of older messages giving user fast response and could be useful for Siskin IM to allow it for fast reconnection.

Andrzej Wójcik (Tigase) commented 5 years ago

I've decided to switch order of synchronization (from oldest to newest) as it simplifies things a lot. We can always make a switch later on, however it may break: chat states, OMEMO, etc.

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
Version
4.0
Spent time
13h
Issue Votes (0)
Watchers (0)
Reference
tigase/_clients/beagle-im#246
Please wait...
Page is in error, reload to recover