thunderbird / thunderbird/stormbox

Defer ambiguous cross-account Email/copy retries

Open
#88 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
105
Forks
9
Avg merge
18h 18m
Merged PRs (30d)
16

Description

Problem

If Stalwart commits a cross-account Email/copy but the response is lost, Stormbox may retry and create a duplicate. JMAP has no persistent copy idempotency key, and Stalwart currently creates a new Email instead of returning alreadyExists with the first copy's ID.

The same upstream behavior is needed when Stormbox receives a successful copy response but destination cache/view reconciliation subsequently fails. Retrying the whole copy is only safe if Stalwart returns alreadyExists(existingId); otherwise a retry can duplicate the already-confirmed copy. We are intentionally not adding a separate server_response_json reconciliation checkpoint while waiting for the server fix.

Decision

Do not add a client-side marker or checkpoint workaround for now. Wait for Stalwart to implement Cyrus-style duplicate detection for repeated Email/copy requests. Once available, Stormbox must fetch existingId, ensure the requested destination mailbox membership, and then reconcile the destination cache.

This affects only cross-account copies; same-account moves use Email/set. Exposure is currently limited because shared/multi-account workflows are not widely used.

Related: #79

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracking Stalwart's duplicate-detection fix for repeated cross-account Email/copy requests; no Stormbox file or test is named here. Once alreadyExists(existingId) is available, follow the stated flow: fetch existingId, ensure destination mailbox membership, and reconcile the destination cache without adding a client-side marker or checkpoint.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.