Skip to content

fix(outbox): Skip messages with status error#12559

Open
kesselb wants to merge 1 commit intomainfrom
bug/noid/outbox-retry
Open

fix(outbox): Skip messages with status error#12559
kesselb wants to merge 1 commit intomainfrom
bug/noid/outbox-retry

Conversation

@kesselb
Copy link
Contributor

@kesselb kesselb commented Mar 13, 2026

Messages in the outbox with status error are currently stuck.

To avoid spamming the logs, we skip them for now.

As mentioned by copilot in the first review, there's indeed a bit of weirdness around the status (e.g. status can be final or temporary, the initial state is null, etc).

I will try to rework that in a follow up.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates outbox “due message” selection to skip messages that are in an indeterminate error state (STATUS_ERROR), preventing them from being retried during outbox flush.

Changes:

  • Exclude STATUS_ERROR messages from LocalMessageMapper::findDue().
  • Add an integration test intended to verify that findDue() skips errored messages.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lib/Db/LocalMessageMapper.php Adds a status != STATUS_ERROR filter to the “due messages” query.
tests/Integration/Db/LocalMessageMapperTest.php Introduces a new test case for skipping STATUS_ERROR in findDue().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

$this->mapper->update($this->entity);

$result = $this->mapper->findDue(200);
$this->assertCount(2, $result); // fail on purpose
$qb->expr()->isNotNull('send_at'),
$qb->expr()->eq('type', $qb->createNamedParameter($type, IQueryBuilder::PARAM_INT), IQueryBuilder::PARAM_INT),
$qb->expr()->lte('send_at', $qb->createNamedParameter($time, IQueryBuilder::PARAM_INT), IQueryBuilder::PARAM_INT),
$qb->expr()->neq('status', $qb->createNamedParameter(LocalMessage::STATUS_ERROR, IQueryBuilder::PARAM_INT), IQueryBuilder::PARAM_INT),
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb kesselb force-pushed the bug/noid/outbox-retry branch from 29c16e0 to 438419b Compare March 17, 2026 14:49
@kesselb kesselb requested a review from Copilot March 17, 2026 14:49
@kesselb kesselb marked this pull request as ready for review March 17, 2026 14:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the outbox background sender to avoid attempting delivery of messages that are already marked as having an indeterminate/error send state.

Changes:

  • Skip processing outbox messages whose status is LocalMessage::STATUS_ERROR during OutboxService::flush().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

if ($message->getStatus() === LocalMessage::STATUS_ERROR) {
// Skip messages with status error
Comment on lines +232 to +235
if ($message->getStatus() === LocalMessage::STATUS_ERROR) {
// Skip messages with status error
continue;
}
@kesselb
Copy link
Contributor Author

kesselb commented Mar 17, 2026

/backport to stable5.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants