Skip to content

fix(template_mailer): never hand templated email to itself (PPT-2816) - #635

Merged
stakach merged 1 commit into
masterfrom
PPT-2816-template-mailer-next
Sep 30, 2026
Merged

stakach merged 1 commit into
masterfrom
PPT-2816-template-mailer-next

Conversation

@camreeves

Copy link
Copy Markdown
Contributor

What

The Template Mailer chose system.implementing(Interface::Mailer)[1] as the mailer to hand rendered email to. That index is a position in a redis hash with no defined order. On HIO UAT on 24 Sep a system edit rewrote the hash with the Calendar module ahead of the mailers, so index 1 became the Template Mailer itself: a direct send_template recursed until core-0 was OOM killed, and the visitor mailer's sends (index 0) went to the Calendar module, which has no templates and logged a warning nobody sees.

The mailer is now the next Mailer after this module in the system (Mailer_2 for Mailer_1), never this module, with the first other Mailer as the fallback. The spec's two mock mailers now record on Mailer_1, since the driver under test is not in the spec runner's module map.

Related

  • placeos/driver: implementing returns modules in the system's module order instead of redis hash order, so index 0 is stable for the other mailer users.
  • PlaceOS/core: mapping writes for one system are serialised so two overlapping updates cannot interleave.

PPT-2816, root cause on the ticket.

The Template Mailer picked the module at index 1 of the system's Mailer
implementers. That list comes from a redis hash with no defined order,
and after a system edit on HIO UAT the order changed so that index 1 was
the Template Mailer itself: every templated send recursed until core was
OOM killed, and the visitor mailer's sends went to the Calendar module.

The mailer is now the next Mailer after this module in the system, and
never this module, with the first other Mailer as the fallback.

PPT-2816
@camreeves
camreeves marked this pull request as ready for review September 28, 2026 06:50
@camreeves
camreeves requested a review from stakach September 28, 2026 06:50

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@camreeves camreeves self-assigned this Sep 29, 2026

@stakach stakach left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@stakach
stakach merged commit 6af786f into master Sep 30, 2026
3 of 6 checks passed
@stakach
stakach deleted the PPT-2816-template-mailer-next branch September 30, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants