Mail app hangs when moving messages to large mailboxes
Open
Nobody has claimed this yet.
0. to triage
bug
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 348
- Avg merge
- 12h 28m
- Merged PRs (30d)
- 91
Description
Steps to reproduce
- Have an "Archive" folder with > 7000 threads / 9500 messages.
- Open the mail app.
- Click on a message 3-dot menu.
- Move it to "Archive".
- Do the same for another message (or a couple more).
Expected behavior
Messages are moved and app behaves normally.
Actual behavior
App hangs browser for around 5 min.
Mail app version
1.14.1
Mailserver or service
dovecot
Operating system
freebsd 13.1
PHP engine version
PHP 8.1
Web server
Apache
Database
MariaDB
Additional info
Nextcloud logs warnings of the type:
[mail] Warning: Controller OCA\Mail\Controller\MailboxesController::sync executed 169 queries.
POST /apps/mail/api/mailboxes/32/sync
from ***.***.***.*** by *** at 2022-10-21T07:56:42+00:00
Firefox profiler shows addEnvelope being called more than 7000 times (capture only ran around half a minute).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The reported path is POST /apps/mail/api/mailboxes/32/sync; start by tracing MailboxesController::sync and the addEnvelope calls shown in the Firefox profiler. Reproduce with a mailbox over 7,000 threads and verify that moving several messages no longer hangs the browser or triggers thousands of repeated calls or queries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php
- Domain
- api, backend, frontend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100