Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sending erroneous message repeatedly #6602

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

ChristophWurst
Copy link
Member

@ChristophWurst ChristophWurst commented May 31, 2022

Fixes #6540

Steps to test

  1. Write a message to invalid
  2. Wait 10s
  3. See the message fail
  4. Wait for your background outbox service or run cron.php manually

Master: message is attempted to be sent again
Here: message is not sent a second time

$schema = $schemaClosure();

$localMessageTable = $schema->getTable('mail_local_messages');
$localMessageTable->addColumn('failed', 'boolean', [
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to add another column here to store some details about the error?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can, but how and what shall we store? The raw exception message can't be localized. We would need to have some specific errors that can be processed for the user, e.g. "Invalid recipient", then define error codes for them and show localized messages to the user.

As a first measure to prevent the endless resending of messages I would keep it simple and just have the boolean flag.

@ChristophWurst ChristophWurst requested review from kesselb and st3iny June 1, 2022 06:37
@ChristophWurst ChristophWurst force-pushed the fix/erroneous-message-sent-repeatedly branch 2 times, most recently from 8181f2f to 660a657 Compare June 2, 2022 15:33
@ChristophWurst ChristophWurst requested a review from miaulalala June 7, 2022 11:14
@ChristophWurst
Copy link
Member Author

/backport to stable1.13

@ChristophWurst
Copy link
Member Author

/backport to stable1.12

Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

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

Tested and works. Already looked at the code earlier.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@ChristophWurst ChristophWurst force-pushed the fix/erroneous-message-sent-repeatedly branch from b75275d to 0b0e905 Compare June 7, 2022 11:34
@ChristophWurst ChristophWurst enabled auto-merge June 7, 2022 11:34
@ChristophWurst ChristophWurst merged commit 092ab9a into main Jun 7, 2022
@ChristophWurst ChristophWurst deleted the fix/erroneous-message-sent-repeatedly branch June 7, 2022 11:41
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.

E-mail is re-sent again on each background job update
3 participants