Skip to content

fix(ui): delete selected threads one after another - #14267

Open
dillardblom wants to merge 1 commit into
nextcloud:mainfrom
dillardblom:fix/sequential-thread-delete
Open

dillardblom wants to merge 1 commit into
nextcloud:mainfrom
dillardblom:fix/sequential-thread-delete

Conversation

@dillardblom

Copy link
Copy Markdown
Contributor

Summary

Deleting a selection of threads can lock the account for up to three hours. Afterwards every sync fails with "Too many auth attempts", and so does occ mail:account:diagnose, without contacting the mail server.

What happens

deleteAllSelected() sends one delete request per selected thread at the same time (Promise.all), and each request logs in to IMAP. Mail servers that throttle parallel logins refuse part of them with a plain NO, which Horde reports as "Mail server denied authentication.". The auth rate limiter in HordeImapClient counts that as a failed login, and after three of them it refuses every login for the rest of the three-hour window.

Seen on a production instance: deleting 12 selected threads sent 12 DELETE /api/thread/{id} requests within the same second. 10 of them failed with "Mail server denied authentication.", and the account stayed locked until the window ended.

Fix

Delete the selected threads one after another and stop at the first error, instead of sending more requests that fail the same way. The threads still disappear from the list as they are deleted.

A bulk endpoint (#10280) would remove the login per thread altogether. That is a larger change and is left out here.

Test plan

  • Unit test: the second thread is only deleted after the first one has finished. It fails without the change.
  • Unit test: after a failed thread no further threads are deleted and one error is shown. It fails without the change.

Deleting a selection sent one request per thread at the same time, so
every selected thread opened its own IMAP connection at once. Servers
that throttle parallel logins answer part of them with a plain NO, which
the auth rate limiter counts as a failed login. After three of those the
account stays locked for the rest of the three-hour window, and syncing
fails with "Too many auth attempts".

Await the deletions in sequence and stop at the first error instead of
sending more requests that fail the same way. A bulk endpoint (nextcloud#10280)
would remove the per-thread login altogether and is left out here.

Signed-off-by: Dillard Blom <dillard.blom@ensembia.com>
dillardblom added a commit to dillardblom/nextcloud-mail that referenced this pull request Nov 20, 2026
…tcloud#14267

Signed-off-by: Dillard Blom <dillard.blom@ensembia.com>
dillardblom added a commit to dillardblom/nextcloud-mail that referenced this pull request Nov 20, 2026
…tcloud#14267

Signed-off-by: Dillard Blom <dillard.blom@ensembia.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant