thunderbird / thunderbird/stormbox
Serialize folder mutations across tabs
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 105
- Forks
- 9
- Avg merge
- 18h 18m
- Merged PRs (30d)
- 16
Description
Problem
The worker outbox serializes message mutations by target_message_id, but folder mutations have no shared folder target and receive row-unique lock keys. Pending folder state in Pinia is also tab-local.
Two tabs can therefore enqueue subscription, rename, move, or delete operations for the same folder concurrently. The requests may execute out of order and produce confusing last-write-wins behavior or policy errors.
This was intentionally deferred from the shared-folder stack.
Suggested initial fix
Because folder mutations are comparatively rare, serialize all Mailbox mutations through one lock key per JMAP backend/session in the SharedWorker. A later optimization may refine this to one lock per owning account or Mailbox target.
Acceptance criteria
- Folder mutations from separate tabs execute in deterministic queue order.
- Mutations for the same folder cannot interleave.
- Message mutation concurrency remains unchanged.
- Failure of one folder mutation does not permanently block later queued folder mutations.
- Browser-level tests exercise two tabs against the same SharedWorker.
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
Start by tracing the SharedWorker worker outbox, its folder and message lock keys, and the Pinia pending-folder state. Run or extend the browser-level tests with two tabs against the same SharedWorker; done means folder mutations queue deterministically, same-folder mutations do not interleave, message concurrency is unchanged, and a failed mutation does not block later ones.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100