Repository navigation
fix(delivery): record ambiguous final loss as durable notice debt - #121833
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
obviyus
force-pushed
the
investigate/issue-80362
branch
2 times, most recently
from
August 11, 2026 03:38
bba590f to
b1cd4d9
Compare
obviyus
force-pushed
the
investigate/issue-80362
branch
2 times, most recently
from
August 11, 2026 04:07
ec5c4b9 to
9ef31b9
Compare
obviyus
enabled auto-merge (squash)
August 11, 2026 05:35
obviyus
disabled auto-merge
August 11, 2026 05:43
obviyus
force-pushed
the
investigate/issue-80362
branch
2 times, most recently
from
August 11, 2026 06:06
c4af4da to
3ff8211
Compare
obviyus
enabled auto-merge (squash)
August 11, 2026 06:09
obviyus
disabled auto-merge
August 11, 2026 06:10
obviyus
force-pushed
the
investigate/issue-80362
branch
2 times, most recently
from
August 11, 2026 06:22
1538b80 to
5fbcfe4
Compare
obviyus
enabled auto-merge (squash)
August 11, 2026 06:23
obviyus
force-pushed
the
investigate/issue-80362
branch
from
August 11, 2026 06:39
5fbcfe4 to
4037014
Compare
obviyus
disabled auto-merge
August 11, 2026 06:44
obviyus
force-pushed
the
investigate/issue-80362
branch
from
August 11, 2026 07:33
5653464 to
88cd674
Compare
obviyus
enabled auto-merge (squash)
August 11, 2026 07:39
obviyus
force-pushed
the
investigate/issue-80362
branch
from
August 11, 2026 07:45
88cd674 to
481892f
Compare
A final whose platform send outcome stays unknown now records owed pendingDeliveryNotice debt in the session entry; the next same-route turn delivers one "could not confirm delivery" notice and acknowledges it into the transcript. Restart recovery completes ambiguous sessions with the same debt instead of failing them with a fire-and-forget notice that is lost during the outage that caused the ambiguity. Permanent typed PlatformMessageNotDispatchedError rejections settle as terminal suppression (proven no-send: no replay, no false notice); Google Chat's media-only service-account rejection uses the typed contract and distinguishes PATCH 404 from response loss. Telegram binds native-command replies into pending-final custody and no longer converts a cleanup crash on an already-accepted preview into a delivery failure. Fixes #80362
This was referenced Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes #80362: a Telegram (or any channel) final reply whose platform send was accepted but whose response was lost ended in silence — the user got nothing, and nothing explained why. grammY wraps pre-connect failures and accepted-response-loss in the same outer error, so the original regex-based classification could not distinguish them safely.
Why This Change Was Made
This PR is rebuilt on top of #121908 (dispatcher-owned pending-final custody) and adds only what that change does not cover:
pendingDeliveryNotice): custody that staysunknownafter a claimed send records owed debt in the session entry. The next same-route turn delivers one "could not confirm delivery" notice and acknowledges it into the transcript. Restart recovery completes ambiguous sessions with the same debt instead of a fire-and-forget notice that is lost during the very outage that caused the ambiguity. The debt survives session reset and daily/idle rollover. Residual records without notice identity keep the visible fail path instead of completing silently.PlatformMessageNotDispatchedError(retryable: false) settles as terminalsuppressed— a proven no-send must not replay or owe a false notice. A retryable typed rejection restorespreparedcustody so recovery replays it (the pre-I/O claim writesunknown; leaving it would fake ambiguity).Superseded parts of the earlier revision (cross-channel adapter adoption, queue publication ordering, dispatcher rewrites) were dropped in favor of the landed #121908 design.
Recorded review rebuttal (notice replacement): a newer owed notice may replace an older
unresolvedone. The notice text is generic same-route uncertainty, so one owed notice covers both losses and is strictly more actionable than retaining a terminal failed-delivery record; keeping both would grow the model into a notice list for a double-failure edge case. Accepted tradeoff.Maintainer decision (recorded): resolve #80362 with durable visible recovery (no blind resend + owed uncertainty notice) rather than adding a retry contract on grammY's opaque outer error. Decided by the repo owner during this rework; a safe-retry path can be revisited if grammY ever exposes trustworthy pre-connect evidence.
User Impact
An ambiguous delivery loss now always ends in a visible outcome: the reply is never blindly resent, and the user is told once, on their next contact, that the previous reply may not have arrived. Known no-send failures (for example Google Chat media-only replies) fail visibly without a false "may not have arrived" notice.
Evidence
tsgo:test:src,tsgo:extensions:test, plugin-sdk API baseline regenerated, format/lint clean.