mustang-im / mustang

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

OWA: Too many connections, and 100% CPU when searching for persons #150

Open benbucksch opened 1 month ago

benbucksch commented 1 month ago

Reproduction

  1. Setup a few mail accounts with a realistic amount of email and contacts
  2. Open the Vertical view image
  3. Switch to Person view image
  4. Click on 1-2 persons

Actual result

Expected result

NeilRashbrook commented 1 month ago

I don't make server calls if the UI doesn't ask for them. The OWA code is very similar to the IMAP code in that it unconditionally makes a server call every time the UI marks a message as read. I assume you're getting away with this in IMAP because the library requires you to lock the mailbox effectively serialising the requests?

I have no idea why your UI might be trying to grab focus. is it doing this in response to trying to display the error banner?

benbucksch commented 1 month ago

I assume the OWA calls that caused the server overload were not the markRead() calls, but that this just happens to be the last one, and the server had already locked us out at this point. The OWA call that caused the overload was most likely another call.

FWIW, my paid (!) @outlook.com account was locked due to "terms of use violations" (maybe because of this bug, impossible to tell), so I cannot test anymore. This is a serious bug that might cause the user harm beyond Mustang, so we have to get this fixed.

benbucksch commented 1 month ago

Did you try the reproduction? Make sure to use a fresh @outlook.com account that you don't need.

NeilRashbrook commented 1 month ago

I tried the reproduction with the Office 365 account but I didn't even hit my breakpoint on callOWA once, so your STR are insufficient.

benbucksch commented 1 month ago

There are 2 problems here:

(Typo corrected)

NeilRashbrook commented 1 month ago

Don't you mean our OWA client?

benbucksch commented 1 month ago

I did. Corrected.