Skip to content

refactor(email): give the transactional sender resolver one home - #7162

Open
viktormarinho wants to merge 1 commit into
mainfrom
t3code/dedupe-transactional-sender
Open

viktormarinho wants to merge 1 commit into
mainfrom
t3code/dedupe-transactional-sender

Conversation

@viktormarinho

@viktormarinho viktormarinho commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Follow-up cleanup on #7159. pr-ready-email.ts shipped a byte-for-byte copy of dbos-digest.ts's resolveSender — same body, same comment about reusing the invitation provider. My duplication; extracting it now, before a third caller copies it again.

The resolver moves next to createEmailSender, which is what it builds.

No behavior change. Both call sites resolve the same provider in the same order (explicit inviteEmailProviderId, else the first configured one), so a deployment with no provider still sends nothing and stamps nothing.

The workflow-source snapshot moves because dbos-digest.ts changed. Recovery-compatible — one call swapped for an identical one, no step added, removed or reordered — so DBOS_WORKFLOW_VERSION stays at 11.

Validation: workspace type checks, lint (14 pre-existing warnings, 0 errors), knip, formatting, and 8,709 unit tests all pass.


Summary by cubic

Consolidates the duplicated transactional sender resolution from dbos-digest.ts and pr-ready-email.ts into one resolveTransactionalSender in email-providers.ts. No behavior change — deployments without a provider still send nothing and stamp nothing.

Refactors

  • Moves the resolver next to createEmailSender, which it builds.
  • Both call sites resolve the same provider in the same order.
  • The workflow-source snapshot updates because dbos-digest.ts changed; recovery-compatible, so DBOS_WORKFLOW_VERSION stays at 11.

Written for commit cfa01e6. Summary will update on new commits.

Review in cubic

`pr-ready-email.ts` shipped a byte-for-byte copy of `dbos-digest.ts`'s
`resolveSender` — same body, same comment about reusing the invitation
provider. That's my duplication from #7159; extracting it now, before a
third caller copies it again.

It lives next to `createEmailSender`, which is what it builds. No
behavior change: both call sites resolve the same provider in the same
order, so a deployment with no provider still sends nothing and stamps
nothing.

The workflow-source snapshot moves because `dbos-digest.ts` changed.
Recovery-compatible — one call swapped for an identical one, no step
added, removed or reordered — so DBOS_WORKFLOW_VERSION stays at 11.

This branch has not been deployed

No deployments
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.

1 participant