← Back to PRs

#14462: fix(messaging): preserve case in target normalization fallback (#14263)

by lailoo open 2026-02-12 05:30 View on GitHub →
stale size: S
## 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