Open
Conversation
There was a problem hiding this comment.
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_ERRORmessages fromLocalMessageMapper::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 |
lib/Db/LocalMessageMapper.php
Outdated
| $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>
29c16e0 to
438419b
Compare
There was a problem hiding this comment.
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_ERRORduringOutboxService::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; | ||
| } |
Contributor
Author
|
/backport to stable5.7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.