#17818: Fix Signal reaction notification missing sender (support legacy 'source' field)
channel: signal
stale
size: S
trusted-contributor
Cluster:
Signal Reaction Fixes
## Description
Some versions of `signal-cli` (or when communicating with older peers) may send the sender's phone number in the legacy `source` field instead of `sourceNumber`. This caused `resolveSignalSender` to return null, silently dropping the reaction notification.
## Fix
Update `resolveSignalSender` to check `source` as a fallback for `sourceNumber`.
## Tests
Added `src/signal/monitor/event-handler.reaction-sender.test.ts` verifying:
- `sourceNumber` is preferred
- `source` (legacy) is accepted as fallback
- `sourceUuid` still works (for unknown contacts)
## AI Transparency
- **Assisted by**: OpenClaw Agent (Claude 3.5 Sonnet / Opus)
- **Testing level**: Fully tested with new unit tests (`src/signal/monitor/event-handler.reaction-sender.test.ts`)
- **Prompt strategy**: Self-correction loop based on codebase analysis
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR fixes a bug where Signal reaction notifications were silently dropped when using older `signal-cli` versions or communicating with older peers that send the sender's phone number in the legacy `source` field instead of `sourceNumber`.
- Updated `resolveSignalSender` in `src/signal/identity.ts:36` to check `source` as a fallback when `sourceNumber` is not present
- Added the `source` field to `SignalEnvelope` type definition for proper type safety
- Added comprehensive unit tests covering all sender resolution scenarios including the new fallback behavior
The fix is minimal, backward-compatible, and correctly prioritizes `sourceNumber` over the legacy `source` field when both are present.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with no risk - it's a focused backward-compatibility fix with comprehensive test coverage
- The fix is minimal (one-line logic change), well-tested with 5 comprehensive test cases covering all scenarios, maintains backward compatibility, follows existing code patterns, and includes proper TypeScript type updates. The fallback logic correctly prioritizes the newer field over the legacy field.
- No files require special attention
<sub>Last reviewed commit: c7bfeb2</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#10958: fix: Signal UUID allowlist entries silently fail when sourceNumber ...
by meaadore1221-afk · 2026-02-07
80.5%
#18511: fix(signal): signal:-prefixed phone numbers fail target resolution ...
by yinghaosang · 2026-02-16
76.2%
#12984: fix(signal): fall back to JSON-RPC for health check on signal-cli 0...
by omair445 · 2026-02-10
75.1%
#17453: fix(signal): make group reactions deterministic from inbound sender...
by akalypse · 2026-02-15
75.0%
#19358: test(signal): add E.164 format acceptance for signal target detection
by saurav470 · 2026-02-17
74.4%
#16562: fix(signal): preserve case for group and username targets
by akalypse · 2026-02-14
73.7%
#22540: fix(signal): preserve original filename in outbound attachments
by lailoo · 2026-02-21
72.7%
#8271: feat(signal): Add full quoted message context support
by ProofOfReach · 2026-02-03
72.4%
#20722: fix(signal): use correct JSON-RPC param names for sendReaction
by arjunblj · 2026-02-19
71.8%
#9734: fix(telegram): correct sender identification for channel messages (...
by divol89 · 2026-02-05
71.3%