#4390: fix(whatsapp): allow media from allowlisted groups without groupAllow…
channel: whatsapp-web
commands
## Summary
Fixes #3375 - WhatsApp media from group members not downloaded when using groupPolicy: allowlist
## Problem
When a group is in the `groups` allowlist with `requireMention: false`, media from group members was silently ignored unless they were also in `groupAllowFrom`.
## Solution
Modified `checkInboundAccessControl` to first check if a group is explicitly in the `groups` allowlist. When it is, messages from all participants are now allowed (bypassing the `groupAllowFrom` check for that group).
## Changes
- `src/web/inbound/access-control.ts` - Added groups allowlist check before groupAllowFrom filtering
- `src/web/inbound/monitor.ts` - Pass groupId to access control function
- `src/web/inbound/access-control.groups-allowlist.test.ts` - 6 new test cases
## Testing
- [x] All 6 new tests pass
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adjusts WhatsApp inbound access control for `groupPolicy: "allowlist"` so that if a group JID is explicitly present in the per-account `groups` config, messages from any participant in that group are allowed (bypassing `groupAllowFrom`). To support that, the inbound monitor now passes the group’s JID into `checkInboundAccessControl`, and a new Vitest suite covers allowlisted vs non-allowlisted group behavior, disabled policy behavior, and wildcard sender allowlisting.
The change lives in the inbound pipeline (`src/web/inbound/monitor.ts` → `checkInboundAccessControl`), and is intended to align sender/media handling with the existing group allowlist semantics used elsewhere in the WhatsApp web channel.
<h3>Confidence Score: 4/5</h3>
- This PR is likely safe to merge, with one notable edge-case around allowlist membership checking.
- Behavioral change is localized to group allowlist handling and is covered by new tests. The main risk is the `in`-operator allowlist membership check, which can produce false positives for inherited keys and is easy to harden.
- src/web/inbound/access-control.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#5665: fix: match group JIDs in groupAllowFrom allowlist
by koala73 · 2026-01-31
90.3%
#11611: feat: separate group-level allowlist from sender-level command auth...
by thisnick · 2026-02-08
89.5%
#6567: fix: include paired users in WhatsApp group sender allowlist
by giannisanni · 2026-02-01
86.9%
#23288: feat(whatsapp): group command gating via commands.allowFrom + sende...
by rodrigoscoelho · 2026-02-22
83.7%
#4402: fix: store group messages from non-allowlisted senders as pending c...
by adam91holt · 2026-01-30
83.0%
#12069: fix(whatsapp): handle native group @mentions with requireMention
by abhishek0450 · 2026-02-08
82.5%
#14789: fix: per-account dmPolicy ignored in checkInboundAccessControl
by croll83 · 2026-02-12
82.2%
#21889: fix(whatsapp): include outbound DMs in agent context for allowed co...
by mactsk · 2026-02-20
81.6%
#22106: fix(whatsapp): honor selfChatMode override for group mentions
by sportclaw · 2026-02-20
81.4%
#10196: fix(whatsapp): sanitize raw mention IDs in outbound messages
by koala73 · 2026-02-06
80.7%