← Back to PRs

#19358: test(signal): add E.164 format acceptance for signal target detection

by saurav470 open 2026-02-17 18:26 View on GitHub →
size: XS
Fix Signal media validation rejecting valid conversation targets. Fixes #18783 <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR fixes a bug where `looksLikeSignalTargetId` rejected `signal:`-prefixed E.164 phone numbers (e.g. `signal:+15551234567`), causing media and message send operations to fail when targets were specified with the full channel-qualified prefix. - In `signal.ts`, the final phone-number check now strips an optional `signal:` prefix before applying the `/^\+?\d{3,}$/` regex, consistent with how `normalizeSignalMessagingTarget` already handled the prefix. - The test block in `plugins-channel.test.ts` covers both positive cases (`signal:+E.164`, bare `+E.164`) and negative cases (`signal:notanumber`, `signal:` empty string), giving reasonable coverage for the new branch. - The fix is minimal, targeted, and consistent with the existing prefix-stripping pattern used throughout `signal.ts` and `extensions/signal/src/channel.ts`. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge; the change is a small, well-targeted regex fix with adequate test coverage and no regressions to existing behavior. - The diff is two files, a single-line logic change plus five test assertions. The fix is directly analogous to how `normalizeSignalMessagingTarget` already handles the `signal:` prefix. Manual trace of old vs new behavior confirms only `signal:`-prefixed phone numbers are newly accepted, which is the intended fix. Negative cases are tested. No security concerns, no regressions to UUID/group/username paths. - No files require special attention. <sub>Last reviewed commit: 9819b2f</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs