If you restart /upgrade (web) or the app is killed in background while processing to_devices coming down the sync, the non decrypted to_devices will be dropped and lost producing UISIs.
This is problem with atomicity of /sync. The sync token is persisted before all to_devices have been processed, so the next time the app launches it will use the saved token, thus ack'ing the previous to_device chunk that was received. In such case the app should start syncing with the previous token to force a redelivery of the initial to_device chunk (or make sure that it permanently persists the to-device messages before storing the /sync token). Olm session internal state should also be reverted if the sync does not complete.
If you restart /upgrade (web) or the app is killed in background while processing to_devices coming down the sync, the non decrypted to_devices will be dropped and lost producing UISIs.
This is problem with atomicity of
/sync. The sync token is persisted before allto_devices have been processed, so the next time the app launches it will use the saved token, thus ack'ing the previousto_devicechunk that was received. In such case the app should start syncing with the previous token to force a redelivery of the initialto_devicechunk (or make sure that it permanently persists the to-device messages before storing the/synctoken). Olm session internal state should also be reverted if the sync does not complete.