mustang-im / mustang

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

EWS: Contacts: Error handling #94

Open benbucksch opened 1 week ago

benbucksch commented 1 week ago

image

The server is overloaded. (Too many concurrent connections opened., Cannot open mailbox. Server = AM0P191MB0594.EURP191.PROD.OUTLOOK.COM, maiboxGuid = f40d9388-a1a7-4c36-b962-2b583e213c53)

OwlError@moz-extension://c55e1444-6e01-4898-bc72-f48d2c898031/shared/misc.js:91:5 TooManyRequestsServerError@moz-extension://c55e1444-6e01-4898-bc72-f48d2c898031/shared/misc.js:98:5 CallServiceUnqueued@moz-extension://c55e1444-6e01-4898-bc72-f48d2c898031/owa/owa.js:272:11 asyncCallService@moz-extension://c55e1444-6e01-4898-bc72-f48d2c898031/owa/owa.js:220:24 OWAAccount.prototype.GetPersona@moz-extension://c55e1444-6e01-4898-bc72-f48d2c898031/owa/contacts.js:747:28 OWAAccount.prototype.FullContactUpdate@moz-extension://c55e1444-6e01-4898-bc72-f48d2c898031/owa/contacts.js:202:33 OWAAccount.prototype.ResyncContacts@moz-extension://c55e1444-6e01-4898-bc72-f48d2c898031/owa/contacts.js:372:14 asyncOWAAccount.prototype.ResyncAddressBooks@moz-extension://c55e1444-6e01-4898-bc72-f48d2c898031/owa/contacts.js:499:18 asyncStartupAfterLogin@moz-extension://c55e1444-6e01-4898-bc72-f48d2c898031/owa/owa.js:398:16 asyncOWAAccount.prototype.Login@moz-extension://c55e1444-6e01-4898-bc72-f48d2c898031/owa/auth.js:296:14 asyncOWAAccount.prototype.LoginLock/this.pendingLogin<@moz-extension://c55e1444-6e01-4898-bc72-f48d2c898031/owa/auth.js:230:20 OWAAccount.prototype.LoginLock@moz-extension://c55e1444-6e01-4898-bc72-f48d2c898031/owa/auth.js:234:7 OWAAccount.prototype.EnsureLoggedIn@moz-extension://c55e1444-6e01-4898-bc72-f48d2c898031/owa/auth.js:195:14 OWAAccount.DispatchOperation@moz-extension://c55e1444-6e01-4898-bc72-f48d2c898031/owa/owa.js:678:18 async@moz-extension://c55e1444-6e01-4898-bc72-f48d2c898031/owa/owa.js:702:29


  1. I remember that we did this hack in Owl for Thunderbird, because Thunderbird gave us no other way to report errors. In Mustang, we can report server errors using backendError().

  2. Test that such per-contact errors will not break sync and hide the contact permanently.

NeilRashbrook commented 1 week ago

This is an Owl stack trace?

benbucksch commented 1 week ago

:laughing: Indeed, it is! It was saved by Owl in the contact details and then later synced back to the server, which of course shouldn't have happened.

We're not doing stuff like that in Mustang, do we? If not, you can close this ticket.

NeilRashbrook commented 1 week ago

Right now the only errors I'm catching are invalid sync state errors (in which case I just restart the sync from the beginning, although that does technically miss out on any items deleted since the last successful sync).

benbucksch commented 1 week ago

And what happens with the other errors? They abort the sync process and throw into the caller?

NeilRashbrook commented 1 week ago

They all throw into the caller. In addition:

benbucksch commented 1 week ago

Contacts: loses track of sync

Can you please fix that?

benbucksch commented 1 week ago

If a sync fails, we should pick up at the last working sync round, so that we don't lose data.

Also, we need to ensure that we don't keep stumbling over the same record (contact, event, email) in every attempt.

NeilRashbrook commented 1 week ago

Can you please fix that?

Filed PR #101.

Also, we need to ensure that we don't keep stumbling over the same record (contact, event, email) in every attempt.

We download items in batches so we don't know which one we might be stumbling over in that sense, although what I can do is to put a try/catch around the processing of each item in case one of them fails for some reason. (Where would I report the error to again?)

benbucksch commented 1 week ago

what I can do is to put a try/catch around the processing of each item in case one of them fails for some reason.

Yes, that's what I do everywhere, e.g. in IMAP.

(Where would I report the error to again?)

this.account.errorCallback(ex);

(Compare IMAP code)

NeilRashbrook commented 1 week ago

Actually I don't see a try/catch in IMAPFolder::listMessages...

benbucksch commented 1 week ago

Actually I don't see a try/catch in IMAPFolder::listMessages...

IMAPFolder.downloadMessages() has one inside the loop.