Skip to content

refactor!: deliver run grants and trigger mail in one routeMail call - #25

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-10190-deliver-run-grants-and-trigger-mail-in-one-routemail-call
Oct 8, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-10190-deliver-run-grants-and-trigger-mail-in-one-routemail-call

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor
  • The router type is HookRouter, Pick<SidecarRouter, "routeMail"> from @intx/hub-sessions (new peer dependency), replacing the hand-written HookMailRouter.
  • The run-trigger deliverer awaits a single routeMail call with runGrants, so grants and mail share one admission decision; sendRunGrants is no longer used.
  • One unroutable code: RUN_GRANTS_NOT_ROUTABLE and RunTriggerUnroutableCode are removed, RunTriggerUnroutableError takes (address, runId), and isRunTriggerUnroutable uses instanceof.
  • README has an "Upgrading from 0.2" section.

Verified with bun run check (typecheck, lint, format, 48 unit tests) and bun run test:e2e against local Postgres (5 pass). Unit tests cover a router resolving false, runGrants passed in the single call, and one router call per delivery.

BREAKING CHANGE: `HookMailRouter` is replaced by `HookRouter`
(`Pick<SidecarRouter, "routeMail">`); `RUN_GRANTS_NOT_ROUTABLE` and
`RunTriggerUnroutableCode` are removed and `RunTriggerUnroutableError` takes
`(address, runId)`. `@intx/hub-sessions` is a new peer dependency.
@TheGreatAxios
TheGreatAxios merged commit 4ec1222 into main Oct 8, 2026
2 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-10190-deliver-run-grants-and-trigger-mail-in-one-routemail-call branch October 8, 2026 00:48
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