Repository navigation
refactor(channels): share durable ingress monitor - #111186
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b020ad14b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| onDurableAdmission: async (raw) => { | ||
| if (raw.kind === "events-api") { | ||
| await raw.afterDurableAdmission?.(); | ||
| } |
There was a problem hiding this comment.
Keep Slack acknowledgements from blocking unrelated admissions
When concurrent Slack events arrive and one ack() is slow or never resolves, awaiting it here holds the monitor-wide admission/claim lock; src/channels/message/ingress-monitor.ts:418 also chains every later admission through the same admissionTail. Consequently, unrelated events cannot even be durably enqueued or acknowledged, the drain cannot claim ready rows, and stop() waits indefinitely on that acknowledgement. The previous Slack path awaited each event's acknowledgement independently, so preserve the per-row append-before-dispatch ordering without putting the external acknowledgement inside the global admission critical section.
Useful? React with 👍 / 👎.
4b020ad to
b59aba9
Compare
|
Merged via squash.
|
* refactor(signal): share durable ingress monitor * refactor(slack): share durable ingress monitor * refactor(discord): share durable ingress monitor * refactor(imessage): share durable ingress monitor * refactor(twitch): share durable ingress monitor * refactor(tlon): share durable ingress monitor
* refactor(signal): share durable ingress monitor * refactor(slack): share durable ingress monitor * refactor(discord): share durable ingress monitor * refactor(imessage): share durable ingress monitor * refactor(twitch): share durable ingress monitor * refactor(tlon): share durable ingress monitor
What Problem This Solves
Signal, Slack, Discord, iMessage, Twitch, and Tlon each carried local copies of the durable ingress admission, claim, retry, pruning, and shutdown machinery. Keeping those copies aligned made correctness fixes easy to miss across channels and left transport-specific behavior mixed into shared queue lifecycle code.
Why This Change Was Made
This maintainer-requested batch migrates the shared lifecycle idioms onto
createChannelIngressMonitorwhile retaining each channel's payload codec, delivery policy, retry classification, retention, and transport acknowledgement behavior. Signal keeps its debounce fan-out, and Twitch keeps its deferred-claim ownership and composed shutdown signal because those lifecycles are channel-specific; Slack's post-append acknowledgement ordering is protected by the shared admission/claim lock.AI-assisted implementation; I reviewed the complete diff and understand the resulting ownership boundaries.
User Impact
There is no intended user-visible behavior change. Durable ingress behavior is now implemented through one tested monitor path, reducing drift across these six channels while preserving their existing delivery and shutdown semantics.
Evidence
pnpm deadcode:exports: production, full-tree, and scripts scans passed with 0 entries.pnpm deadcode:unused-files: production and full-tree scans passed with 0 entries.git diff --checkpassed.