← Back to PRs

#17818: Fix Signal reaction notification missing sender (support legacy 'source' field)

by Clawborn open 2026-02-16 06:32 View on GitHub →
channel: signal stale size: S trusted-contributor
## 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