Skip to content

Commit e805dbb

Browse files
authored
fix(signal): preserve newlines in debounced messages (#110090)
* fix(signal): use newlines in debounced messages * docs: fix release gate command formatting
1 parent c2a0690 commit e805dbb

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

docs/start/onboarding-redesign.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,16 @@ restart` from the real environment and verify the plist. Product follow-up:
255255
- **Agent landing needs exact-head hosted CI.** The heavy `CI` workflow may
256256
not queue on pushes under org load; the maintainer fallback is a
257257
release-gate dispatch on the PR branch:
258-
`gh workflow run ci.yml --ref <branch> -f target_ref=<head-sha>
259-
-f release_gate=true -f pull_request_number=<pr>` (the run must be on the
258+
259+
```bash
260+
gh workflow run ci.yml --ref <branch> -f target_ref=<head-sha> -f release_gate=true -f pull_request_number=<pr>
261+
```
262+
263+
The run must be on the
260264
branch ref so `head_sha` matches, and the title becomes
261265
`CI release gate <sha>`, which `scripts/verify-pr-hosted-gates.mjs`
262-
accepts). Then `scripts/pr` prepare/merge as usual.
266+
accepts. Then `scripts/pr` prepare/merge as usual.
267+
263268
- **Gates that CI enforces beyond focused tests**: docs map
264269
(`pnpm docs:map:gen` after adding any docs page), oxlint (`no-map-spread`,
265270
`max-lines` — split files, never suppress), `check:test-types`, knip

extensions/signal/src/monitor/event-handler.inbound-context.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ describe("signal createSignalEventHandler inbound context", () => {
336336
).resolves.toEqual({ author: "+15550002222", body: "edited hello" });
337337
});
338338

339-
it("preserves the last debounced message body for native reply quote metadata", async () => {
339+
it("joins debounced message bodies with newlines and preserves the last for replies", async () => {
340340
vi.useFakeTimers();
341341
const deliverRepliesMock = vi.fn().mockResolvedValue(undefined);
342342
dispatchInboundMessageMock.mockImplementationOnce(async (params: any) => {
@@ -386,7 +386,8 @@ describe("signal createSignalEventHandler inbound context", () => {
386386
expect(deliverRepliesMock).toHaveBeenCalledTimes(1);
387387
});
388388
const context = requireCapturedContext();
389-
expect(context.BodyForAgent).toBe("first debounced message\\nsecond debounced message");
389+
expect(context.BodyForAgent).toBe("first debounced message\nsecond debounced message");
390+
expect(context.CommandBody).toBe("first debounced message\nsecond debounced message");
390391
expect(context.ReplyToId).toBe("1700000000002");
391392
expect(context.ReplyThreading).toEqual({ implicitCurrentMessage: "allow" });
392393
expect(deliverRepliesMock.mock.calls[0]?.[0]).toMatchObject({
@@ -2070,8 +2071,8 @@ describe("signal createSignalEventHandler inbound context", () => {
20702071

20712072
const context = requireCapturedContext();
20722073
expect(context.BodyForAgent).toContain("[signal attachment unavailable]");
2073-
expect(context.RawBody).toBe("first request\\nsecond request");
2074-
expect(context.CommandBody).toBe("first request\\nsecond request");
2074+
expect(context.RawBody).toBe("first request\nsecond request");
2075+
expect(context.CommandBody).toBe("first request\nsecond request");
20752076
} finally {
20762077
vi.useRealTimers();
20772078
}

extensions/signal/src/monitor/event-handler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,11 +731,11 @@ export function createSignalEventHandler(deps: SignalEventHandlerDeps) {
731731
const combinedText = entries
732732
.map((entry) => entry.bodyText)
733733
.filter(Boolean)
734-
.join("\\n");
734+
.join("\n");
735735
const combinedCommandBody = entries
736736
.map((entry) => entry.commandBody)
737737
.filter(Boolean)
738-
.join("\\n");
738+
.join("\n");
739739
if (!combinedText.trim()) {
740740
await settle();
741741
return;

0 commit comments

Comments
 (0)