#14462: fix(messaging): preserve case in target normalization fallback (#14263)
stale
size: S
Cluster:
Signal Reaction Fixes
## Summary
Fixes #14263
## Problem
`normalizeTargetForProvider` in `src/infra/outbound/target-normalization.ts` applies `.toLowerCase()` as a fallback when a channel plugin does not implement a custom `normalizeTarget`. This breaks Signal group ID lookups because Signal uses base64-encoded group IDs which are case-sensitive.
## Fix
Replace the fallback `.toLowerCase()` with `.trim()` so that providers without a custom normalizer preserve the original casing. Providers that need lowercasing (e.g. phone-number-based channels) already implement their own `normalizeTarget`.
## Reproduction & Verification
### Before fix (main branch):
`normalizeTargetForProvider` fallback path called `.toLowerCase()`, destroying base64 encoding in Signal group IDs like `group.aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789+/=`.
Note: main already merged a similar fix (#14055 — `don't lowercase Slack channel IDs`) which removed `.toLowerCase()`. This PR adds Signal-specific regression test coverage.
### After fix — All verified:
```
✓ src/infra/outbound/target-normalization.test.ts > normalizeTargetForProvider > preserves case for unknown providers
✓ 1 test pass (pnpm vitest run src/infra/outbound/target-normalization.test.ts)
```
## Testing
- ✅ 1 regression test added and passes
- ✅ Lint passes
Most Similar PRs
#16562: fix(signal): preserve case for group and username targets
by akalypse · 2026-02-14
79.6%
#12793: fix(signal): preserve case-sensitivity for group IDs, UUIDs, and us...
by wilmerdooley1-star · 2026-02-09
79.0%
#22221: fix: preserve case of target ID in normalizeTargetId
by zerone0x · 2026-02-20
75.7%
#13489: fix: preserve Slack channel/user ID case in target normalization
by sandieman2 · 2026-02-10
74.8%
#18511: fix(signal): signal:-prefixed phone numbers fail target resolution ...
by yinghaosang · 2026-02-16
73.3%
#19190: Signal: preserve group ID casing in session keys
by clzoc · 2026-02-17
70.8%
#19358: test(signal): add E.164 format acceptance for signal target detection
by saurav470 · 2026-02-17
67.6%
#17878: Refactor: share allowlist normalization
by iyoda · 2026-02-16
67.0%
#10643: fix(slack): classify D-prefix DMs correctly when channel_type disag...
by mcaxtr · 2026-02-06
65.5%
#18969: Fix #18864: Accept plain openid in qqbot message send
by jwchmodx · 2026-02-17
65.1%