Repository navigation
fix(telegram): reject zero and negative replyToMessageId values - #68306
1aifanatic wants to merge 2 commits into
Conversation
Telegram message IDs must be positive integers. The previous normalizeTelegramReplyToMessageId allowed zero and negative values to pass through, which would produce a 400 reply-not-found error from the Telegram API. Add a > 0 guard for both the numeric and string code paths so invalid values are treated as absent rather than forwarded.
Greptile SummaryAdds a Confidence Score: 5/5Safe to merge — the fix is a narrow, correct validation tightening with full test coverage and no regressions. Both changed code paths are straightforward and correct: the numeric branch truncates then guards with > 0, the string branch parses then guards with > 0. All edge cases (NaN, Infinity, "0", "-5", UUIDs, null, objects) are exercised by the new tests. No P0 or P1 issues found. No files require special attention. Reviews (1): Last reviewed commit: "fix(telegram): reject zero and negative ..." | Re-trigger Greptile |
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep open, but the patch is not merge-ready: the remaining Telegram reply-id bug still exists on current main and the latest release, while this stale branch reintroduces fractional-ID truncation and has no real Telegram proof. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: current main still accepts 0 and negative integers through normalizeTelegramReplyToMessageId, and buildTelegramThreadReplyParams forwards accepted values into Telegram reply parameters. I did not run a live Telegram API repro in this read-only review. Is this the best way to solve the issue? No as submitted. The shared normalizer is the right layer, but the branch must preserve current strict integer parsing while adding the positive-only guard. Security review: Security review cleared: No concrete security or supply-chain concern found; the diff touches Telegram validation, colocated tests, and changelog text only. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against db2786bde105. |
|
Codex review: needs maintainer review before merge. What this changes: This PR updates Telegram reply-to message ID normalization to reject zero and negative numeric or string values and adds focused outbound-parameter tests while preserving thread ID parsing. Maintainer follow-up before merge: This is already a focused implementation PR with no discrete repair needed; the remaining action is maintainer review, CI, and merge or requested revision. Review detailsBest possible solution: Land the narrow Telegram plugin validation fix: require reply-to message IDs to be positive integers in the shared normalizer, keep negative group/thread ID parsing unchanged, and keep the regression coverage focused on reply-id normalization rather than broader Telegram send behavior. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 3215ab6de5db. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
normalizeTelegramReplyToMessageIdnow rejects0and negative values in addition to non-numeric inputs0or a negative value would result in a400 Bad Requestfrom the Telegram APItypeof value === "number") and the string branch now enforce> 0Test plan
normalizeTelegramReplyToMessageId(0)returnsundefinednormalizeTelegramReplyToMessageId(-1)returnsundefinednormalizeTelegramReplyToMessageId("0")returnsundefinednormalizeTelegramReplyToMessageId("-5")returnsundefinednormalizeTelegramReplyToMessageId(42)returns42normalizeTelegramReplyToMessageId("99")returns99undefinedparseTelegramThreadIdbehaviour is unchanged