nextcloud / nextcloud/mail

Avoid double sending of an outbox message

Open
#6,194 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug feature: outbox
Dominant language
JavaScript
Stars
1k
Forks
348
Avg merge
12h 28m
Merged PRs (30d)
91

Description

Is your feature request related to a problem? Please describe.

The outbox implementation triggers the send from two angles: the REST API call to send and the background job that ensures messages are sent even if the front-end doesn't trigger an API call.

It is conceivable that the two methods could trigger a send at the same time and thus send the outbox message twice. (Possibly even with more errors occurring down the line, for example if an attachment is involved)

Strategies discussed so far:

  • locking the table
Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

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 tracing the REST API send path and the background job that sends outbox messages, then examine how both can process the same message concurrently. Define and test behavior for overlapping sends, including cases with attachments; done means concurrent triggers cannot send one outbox message twice.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.