mustang-im / mustang

Mustang - New full-featured desktop email, chat and video conference client
https://mustang.im
Other
8 stars 1 forks source link

Contacts should not lose sync after an error (#94) #101

Closed NeilRashbrook closed 3 months ago

benbucksch commented 3 months ago

So, you're no longer saving intermediate states? How about you save the then-current sync state after each round? Would that work?

NeilRashbrook commented 3 months ago

The other approach is to move listPersons and listGroups inside the loop, which should work, although it might mean more API calls.

benbucksch commented 3 months ago

I guess I don't understand why the old code is wrong. It saves the syncState, then saves the address book. If we didn't have an error until then, we saved all data from the server to the DB, and save the syncState as "checkpoint". If it fails in the next round, then - once the user clicks on "Get Mail" button, or changes folders, or restarts the app - we will make another attempt and pick up at the point before we failed. Right? Is there any problem with that?

The only problem that I see is when there's an item with an error, and we keep throwing, and all messages stop syncing at this point, forever. Thus, we should catch and report errors on a per-item level. This is fixed in #102

NeilRashbrook commented 3 months ago

we saved all data from the server to the DB

No, because that's done by listPersons and listGroups.