Repository navigation
fix(channels): retry abandoned deliveries without penalizing Telegram restarts - #130077
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 7:41 AM ET / 11:41 UTC. ClawSweeper reviewWhat this changesThis PR makes abandoned shared channel deliveries consume retry accounting again while routing Telegram owner shutdown through cancellation that preserves existing retry facts. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep open for normal maintainer review: the exact head restores the shared retry-accounting invariant and keeps Telegram restart cancellation separate; no blocking defect was found. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — execution before step 1 Assertions:
How this fits togetherInbound channel events enter a durable queue and the shared ingress drain either completes, retries, or cancels each claimed event. Telegram’s monitor supplies transport-specific deferred-work outcomes to that shared lifecycle. flowchart LR
A[Inbound channel event] --> B[Durable ingress queue]
B --> C[Shared ingress drain]
C --> D{Pre-adoption outcome}
D -->|Abandoned delivery| E[Record retry attempt and backoff]
D -->|Telegram shutdown| F[Cancel without retry cost]
E --> G[Future delivery retry]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource -2, Tests +11. Total +9 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the canonical split: shared abandonment records retry state, while Telegram restart shutdown invokes cancellation and preserves durable retry facts. Do we have a high-confidence way to reproduce the issue? Yes—source establishes the current-main path: abandonment passes recordAttempt false to the durable release; the focused regressions model both shared abandonment and Telegram shutdown. Is this the best way to solve the issue? Yes—the repair restores the generic owner behavior and uses the existing cancellation callback only for Telegram’s distinct shutdown case, avoiding a Telegram-specific exception in shared code. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e2e5d1bca685. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
Related: #122864, #129974
What Problem This Solves
Fixes an issue where channel users could lose reliable delivery retries or repeatedly reprocess the same failed inbound message after a delivery stopped before adoption. The regression in #122864 changed the shared abandonment lifecycle used by all 18 channel owners while solving a Telegram-specific shutdown problem. It also broke unrelated pull requests in hosted CI, including the Microsoft Teams extension shards for #129974.
Why This Change Was Made
Restore the shared ingress owner's original retry-accounted abandonment contract so genuine failed pre-adoption delivery increments its attempt count, records the attempt time, and respects backoff. Route only Telegram owner shutdown through the existing cancellation callback, which preserves any previous attempts, timestamps, and errors without consuming retry budget. Telegram dispatch-dedupe rollback failures still use the existing terminal failure callback.
This reuses existing lifecycle boundaries and reduces production code by two lines; it does not change public Plugin SDK contracts, SQLite schemas, persisted data formats, security policy, or channel ownership.
User Impact
Inbound delivery failures across supported channels retry with their intended durable accounting, backoff, restart, and threshold behavior again. Telegram sessions can restart without falsely spending retry attempts or replacing a previous delivery error.
Evidence
message-handler.ingress-lifecycle.test.ts:208expected pending attempt 1 with a retry timestamp and instead found no pending row. The unchanged test now passes, including durable backoff, restart, and retry-threshold scenarios.0instead of1,1, and3; all pass afterward.-2lines; formatting and whitespace checks pass. Two independent owner-boundary reviews and the authenticated full-commit review found no actionable issues.