Telegram: fix group messages silently dropped with groupPolicy allowlist + groupAllowFrom but no groups config#28310
Open
harjothkhara wants to merge 2 commits intoopenclaw:mainfrom
Conversation
Contributor
Greptile SummaryCorrectly passes
Confidence Score: 5/5
Last reviewed commit: 275d18c |
When groupPolicy="allowlist" is set with allowFrom/groupAllowFrom but no explicit groups config, the resolveGroupPolicy closure was calling resolveChannelGroupPolicy without hasGroupAllowFrom, so senderFilterBypass was always false. This caused evaluateTelegramGroupPolicyAccess to return group-chat-not-allowed for every group message, silently dropping them. Fixes openclaw#28107.
… groups config Covers the case where groupPolicy="allowlist" is configured with allowFrom or groupAllowFrom but without any per-group groups entries. Authorized senders must pass through; the sender-level filter handles individual access control so the chat-level check must not block all messages in this configuration.
275d18c to
8c74078
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
|
This pull request has been automatically marked as stale due to inactivity. |
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.
Fixes #28307
What
Pass
hasGroupAllowFromin theresolveGroupPolicyclosure insrc/telegram/bot.tsso thatresolveChannelGroupPolicycan activate thesenderFilterBypasspath whengroupPolicy: "allowlist"is set withgroupAllowFrombut no explicit per-groupgroups:entries.Why
resolveChannelGroupPolicyalready contains the correct logic for this case:But the closure in
bot.tsnever forwardedhasGroupAllowFrom, sosenderFilterBypasswas alwaysfalse. The result: when a user configuredgroupPolicy: "allowlist"+groupAllowFromwithout anygroups:block, every inbound group message was silently dropped — even from allowlisted senders.Changes
src/telegram/bot.ts: forwardhasGroupAllowFromin theresolveGroupPolicyclosuresrc/telegram/bot.create-telegram-bot.test.ts: two regression tests coveringallowFromandgroupAllowFromwithout explicitgroups:configTesting
pnpm build✅pnpm check✅pnpm test -- src/telegram/bot.create-telegram-bot.test.ts— 45/45 passed ✅AI-assisted. Fix manually reviewed; regression tests written and verified locally.
🤖 AI-Assisted PR
senderFilterBypasslogic ingroup-policy.tswas already correct and just needed to be wired up