#22654: fix(signal): join debounced messages with actual newline instead of literal \\n
channel: signal
size: XS
trusted-contributor
Cluster:
Network Error Handling Improvements
## Summary
The Signal debounce flush handler joins buffered message texts with a literal
two-character string `\n` instead of an actual newline character. Users receiving
debounced messages see `hello\nworld` as-is, rather than messages separated by
line breaks.
## Bug
```ts
// src/signal/monitor/event-handler.ts, line 304
const combinedText = entries
.map((entry) => entry.bodyText)
.filter(Boolean)
.join("\\n"); // ← escaped backslash-n: produces literal "\n"
```
In JavaScript, `"\\n"` is a two-character string (backslash + n), not a newline.
When the debounce timer fires with multiple queued messages, they are concatenated
with the literal text `\n` instead of a line break.
## Fix
```ts
.join("\n"); // ← actual newline character
```
## Test plan
- [x] `npx oxfmt --check src/signal/monitor/event-handler.ts` — pass
- [x] `npx oxlint src/signal/monitor/event-handler.ts` — 0 warnings, 0 errors
- [x] `npx vitest run src/signal/monitor/event-handler.inbound-contract.test.ts --config vitest.unit.config.ts` — 2 tests pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Fixes Signal debounced messages to use actual newlines instead of literal `\n` characters when combining multiple messages.
- Changed `.join("\\n")` to `.join("\n")` in the debounce flush handler (line 304)
- Aligns with Telegram and Discord implementations, which already use actual newlines
- Follows repository guideline from `AGENTS.md`: "never embed `\\n`" for message content
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with no risk
- Single-character fix that corrects an obvious bug (escaped backslash-n to actual newline). The change matches the pattern used in other channel handlers (Telegram, Discord) and follows the repository's style guidelines. Tests pass and the fix is clearly correct.
- No files require special attention
<sub>Last reviewed commit: 9cbc957</sub>
<!-- greptile_other_comments_section -->
**Context used:**
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#17435: fix(debounce): retry flush with exponential backoff to prevent sile...
by widingmarcus-cyber · 2026-02-15
70.3%
#16733: fix(ui): avoid injected newlines when tool output is hidden
by jp117 · 2026-02-15
69.6%
#8271: feat(signal): Add full quoted message context support
by ProofOfReach · 2026-02-03
69.6%
#15467: feat(messages): add debounceMedia option for inbound debouncing
by tangcruz · 2026-02-13
69.6%
#17254: fix(discord): intercept text-based slash commands instead of forwar...
by robbyczgw-cla · 2026-02-15
69.5%
#4878: fix: string/type handling and API fixes (#4537, #4380, #4373, #4547...
by lailoo · 2026-01-30
69.1%
#17243: fix(telegram): catch getFile network failures to prevent gateway cr...
by robbyczgw-cla · 2026-02-15
69.0%
#15240: fix(bluebubbles): URL dropped when sent in same iMessage bubble as ...
by yinghaosang · 2026-02-13
68.6%
#22101: fix(slack): dedupe mentions by ts fallback for app_mention
by AIflow-Labs · 2026-02-20
68.3%
#7459: fix(signal): resolve mention placeholders to actual names
by gerigk-agent · 2026-02-02
68.2%