fix(telegram): recover stale ingress claims after restart#84690
fix(telegram): recover stale ingress claims after restart#84690zerone0x wants to merge 1 commit into
Conversation
|
Thanks for the context here. I did a careful shell check against current Close: current main already implements the useful change through a broader merged Telegram ingress recovery fix, with regression coverage, maintainer acceptance, and beta release provenance. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. So I’m closing this as already implemented rather than keeping a duplicate issue open. Review detailsBest possible solution: Keep the merged current-main implementation from #97118 and close this obsolete source PR. Do we have a high-confidence way to reproduce the issue? Yes. The stale-claim failure was source-reproducible from the live-owner predicate and is now covered by current-main Telegram spool/polling regression tests. Is this the best way to solve the issue? Yes. The merged current-main replacement is better than this stale PR because it includes the same PID-reuse recovery plus queue-native claiming, drain heartbeat behavior, focused tests, and live Telegram proof. Security review: Security review cleared: The source PR changes Telegram spool ownership logic and tests only; no dependency, workflow, permission, secret, package, or new code-execution surface is introduced. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 561c713bb1f3; fix evidence: release v2026.6.11-beta.2, commit b8e3de11608d. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
martingarramon
left a comment
There was a problem hiding this comment.
LGTM-with-concerns. The core fix is correct — adding `claim.claim.processPid !== process.pid` short-circuits the live-owner check for restart-stale claims that recycled the current gateway PID, and the `polling-session.test.ts` change from `claimedAt: now - STALE_MS - 1` to `claimedAt: now` is important: the old test was passing because `isFreshClaimOwner` returned false (stale path), not because it was exercising the PID-reuse case. The new test covers the actual bug path.
Two actionable concerns:
1. Heading format — blocks CI gate.
`## Real behavior proof (required for external PRs)` should be `## Real behavior proof` (exact heading, no suffix). The CI gate matches the exact string; the `(required for external PRs)` suffix is causing the `Real behavior proof` check failure. Content is complete and correct — only the heading needs trimming.
2. Missing symmetric live-owner test.
The `polling-session.test.ts` change converts the existing blocked-case test into a recovery-case test. That's correct, but there's now no test asserting the symmetric path: "different PID + different processId + fresh + processExists → claim remains blocked." The old test was inadvertently covering this (via the stale path). A focused test for the still-blocked case would close the gap.
The other four CI failures (`check-additional-extension-bundled`, `check-lint`, `check-test-types`, `checks-node-core-runtime-infra-state`) are main-churn unrelated to this diff.
|
ClawSweeper applied the proposed close for this PR.
|
Summary
.json.processingclaim from a previous gateway identity when the PID was reused after recreate, blocking later same-lane updates.processPidequals the current process but whose uniqueprocessIddiffers as recoverable stale claims, not another live owner.Motivation
.processingfile can survive gateway recreate and block later updates until manually moved aside.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
.json.processingclaim from an older gateway identity with the current PID no longer blocks later queued updates.node scripts/run-vitest.mjs extensions/telegram/src/telegram-ingress-spool.test.ts extensions/telegram/src/polling-session.test.ts.processingfile and left only the later update pending.Root Cause (if applicable)
processPid === process.pidbutprocessIdbelongs to an older gateway instance.Regression Test Plan (if applicable)
extensions/telegram/src/telegram-ingress-spool.test.ts,extensions/telegram/src/polling-session.test.ts.json.processingclaim with the current PID but an older/different process identity is recoverable and returns the blocked update to the pending spool.User-visible / Behavior Changes
Telegram isolated polling ingress can recover stale
.processingclaims left behind by a recreated gateway when the PID is reused, preventing later updates from staying blocked indefinitely.Diagram (if applicable)
Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation: N/ARepro + Verification
Environment
Steps
.json.processingusingprocessPid: process.pidand a differentprocessId.Expected
.json; updates 42 and 43 are pending in order.Actual
.json.processingfile.Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
git diff --checkpasses.Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes)No)No)Risks and Mitigations