From 7651fc198feecf5901b33bca6e15954ef26db9fb Mon Sep 17 00:00:00 2001 From: mintaka Date: Fri, 11 Sep 2026 13:59:17 -0400 Subject: [PATCH] docs(ui): route the undefined session-id case to the direct seam (RIG-2874) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The record assigned the `getter returns undefined` case to the capture seam, but `captureRequest`'s fetch always throws, so its `rejects.toThrow()` gate cannot tell "threw early" from "reached next" — green on the very defect the case exists to catch. The guard can throw on undefined, so this case needs the direct seam and all three assertions. --- docs/designs/ui/compass-outbound-session-header/design.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/designs/ui/compass-outbound-session-header/design.md b/docs/designs/ui/compass-outbound-session-header/design.md index b6f5f1b8a..337ee838c 100644 --- a/docs/designs/ui/compass-outbound-session-header/design.md +++ b/docs/designs/ui/compass-outbound-session-header/design.md @@ -579,7 +579,13 @@ Cases: - getter returns a valid id ⇒ request carries `X-POSTHOG-SESSION-ID: ` (capture seam). -- getter returns `undefined` ⇒ header **absent** (not empty) — capture seam. +- getter returns `undefined` ⇒ header **absent** (not empty) — **direct seam, + all three assertions above**. The guard can throw on this input, so absence + alone is not enough. `captureRequest`'s capturing `fetch` always `throw`s + (`index.test.ts:87`), so its gate `rejects.toThrow()` cannot tell "threw + early" from "reached `next`" — it goes green on the very defect the case + exists to catch. Assertion 3 (`result` is the sentinel) is what proves + nothing threw. - getter returns `""` ⇒ header absent — capture seam. - oversized value (201 ASCII chars) ⇒ header absent — capture seam. - **exactly 200 ASCII chars ⇒ header PRESENT** (capture seam). This is the