Uh oh!
There was an error while loading. Please reload this page.
fix(logger): stop a server-side jsdom window from silencing all logging in production - #6339
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview Production suppression in Regression tests cover both paths: server + jsdom Reviewed by Cursor Bugbot for commit 05c305c. Configure here. |
Greptile SummaryThe PR refines production browser detection so a server-side jsdom window no longer disables structured logging while preserving suppression in actual browsers.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/logger/src/index.ts | Replaces the window-only production suppression check with runtime-aware browser detection, preserving logging in Node processes that install jsdom. |
| packages/logger/src/index.test.ts | Adds focused regression tests covering both a Node server with an installed DOM and a production browser environment. |
Reviews (3): Last reviewed commit: "fix(logger): widen the stubbed process c..." | Re-trigger Greptile
waleedlatif1
commented
Aug 6, 2026
waleedlatif1
commented
Aug 6, 2026
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 05c305c. Configure here.
Summary
shouldLog()treatedtypeof window !== 'undefined'as "we are in a browser" and, in production, returnedfalsefor every level — permanently, process-wide, with no diagnosticensureDomForTipTap()(apps/sim/lib/collab-doc/converter.ts:68) assignsglobalThis.window = jsdomWindowso TipTap can run headless. The first collab-markdown request a task serves therefore kills that task's structured logging for the rest of its lifejsdomis a production dependency andnext.config.tsexplicitly traces it into the standalone output for/api/internal/file-doc/{seed,merge,persist}, so this is live in prod. This is the only non-testwindowassignment in the repoprocess.versions.node, a browser never does. The original intent — suppress logging in the browser in production — is preservedEvidence
This is the cause of the recurring multi-hour structured-logging blackouts:
console.*worked; only@sim/loggerwas silenta5989f51served file-doc traffic at 15:00 and went dark at 15:08Type of Change
Testing
Two regression tests, both directions:
should keep logging when the server installs a DOM— red before the fix, green aftershould stay silent in a real browser— passes both before and after, proving the guard's original behavior is intact and this is not simply removing it27/27 passing.
Checklist