IMAP folder update listeners can be lost during offline playback or receive mismatched callbacks
Categories
(MailNews Core :: Networking: IMAP, defect)
Tracking
(Not tracked)
People
(Reporter: welpy-cw, Assigned: welpy-cw)
References
(Blocks 2 open bugs)
Details
Attachments
(1 external file)
When nsImapMailFolder::UpdateFolderWithListener() finds pending offline operations, it replays them before synchronizing the folder. The supplied nsIUrlListener can lose its completion notification or receive OnStopRunningUrl() without a matching OnStartRunningUrl(). An overlapping refresh can also start the same replay twice.
To exercise the replay path, mark a message as read while offline, return online, and call updateFolderWithListener() on that folder with a listener that records callbacks. Hold the first replay response and call updateFolder() to exercise the overlap.
The listener should receive one matching start and completion pair for the folder update. Completion should follow folder synchronization on success and report the failure status when replay fails. A listenerless refresh during replay should share the update already in progress.
This affects direct folder updates and predates the account-wide Get Messages refactor in bug 1980543. The standalone patch includes xpcshell tests for replay, overlapping updates, discovery, reentrant completion, and replay failures in mbox and maildir.
| Assignee | ||
Comment 1•11 days ago
|
||
Associate each folder update listener with its SELECT and notify it after folder cleanup. Route account-wide listeners to the Inbox through the existing retrieval path.
Coalesce listenerless refreshes while a listener-bearing update replays offline operations. Retain the completion listener through asynchronous replay and report terminal failures even when the copy service has no URL.
Exercise successful replay, discovery, reentrant completion, overlapping refreshes, and copy failures in mbox and maildir.
Keep the same listener across follow-up passes when the database still has
queued operations.
Description
•