Repository navigation
fix(debug): avoid retaining query objects when logging is disabled - #30556
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Enabled-aware history recording packages/debug/src/index.ts, packages/debug/src/__tests__/history.test.ts, AGENTS.md |
debugCall checks whether logging is enabled before recording arguments. Disabled calls store errors as name: message, objects and functions as [Object], and other values unchanged. Enabled calls retain original arguments. Tests cover these behaviors, the 100-entry limit, and history controls. Documentation describes the behavior and regression test command. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Merge Risk: 
Minimal · previous review 318fd
-
This change stops disabled debug calls from keeping large objects alive in history while preserving enabled-call behavior. No merge-blocking risk was identified.
Security architecture risk: 
Low · up to 318fd
-
The change reduces retention of query objects when logging is disabled and preserves the inspected credential-protection control. However, Error messages now become visible in diagnostic history and shareable report links. No actual secret disclosure was established, but message sensitivity and downstream report coverage remain incompletely assessed.
Retained concerns
- Low · security · inferred: Disabled logging now promotes Error names and messages into shared diagnostic history. Driver Error arguments reach this history, and a known consumer embeds it in shareable issue-report links without message redaction. This widens report contents compared with ordinary Error serialization in the available base and could expose sensitive message text. No credential disclosure was verified; the inspected MariaDB URL parse-error control remains effective.
Security review details
-
Security Blast Radius
- inferred — The relevant exposure is diagnostic content collected across namespaces sharing this module instance, not newly granted database or infrastructure privileges. An Error message can persist until eviction or clearing and appear in a later report. Complete application, tenant, and report-destination scope is not established.
Security Findings and Attack Paths
- inferred — A conditional disclosure path is driver Error argument to disabled-history message snapshot to getLogs to an issue-report link, followed by user sharing. The representation change and consumer are established, but sensitive message contents, attacker influence over them, and an actual disclosure are not verified.
Trust Boundaries and Controls
- observed — Object summarization limits disabled-history retention but is not a general secret-redaction control: strings and Error messages remain. The inspected report normalizer removes timing text, not sensitive message content. MariaDB instead protects the named parse-failure path at its producer by logging only a fixed string.
Resilience and Maintainability Implications
- observed — Disabled calls no longer retain ordinary query objects, parameter arrays, or closures. The entry-count bound remains unchanged and does not impose a byte bound on preserved strings; enabled history also continues to retain detailed arguments. These remaining retention properties predate the PR.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
-
❌ Failed checks (1 warning)
Check name Status Explanation Resolution Docstring Coverage ⚠️ WarningDocstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold. ✅ Passed checks (4 passed)
-
Check name Status Explanation Linked Issues check ✅ Passed The change satisfies the coding requirements in [ #30494]. When the effective namespace state is disabled,debugCallstores strings and primitive values unchanged, converts errors toname: message,…Out of Scope Changes check ✅ Passed The changes stay within [ #30494]. The added tests verify the requested debug-history behavior. The debug note documents the changed behavior. The source change only updates argument history handling a…Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled. Title check ✅ Passed The title clearly identifies the main change: preventing query objects from being retained when debug logging is disabled.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Autopilot is currently an internal CodeRabbit preview.
ℹ️ Recent review info
-
⚙️ Run configuration
-
Configuration used: Repository: prisma/orm/.coderabbit.yml
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 0447b75f-d77e-4a24-995e-03750780945a
📒 Files selected for processing (3)
-
AGENTS.md
packages/debug/src/__tests__/history.test.ts
packages/debug/src/index.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
ℹ️ Recent review info
-
⚙️ Run configuration
-
Configuration used: Repository: prisma/orm/.coderabbit.yml
Review profile: ASSERTIVE
Plan: Advanced
Run ID:
0447b75f-d77e-4a24-995e-03750780945a
📒 Files selected for processing (3)
-
AGENTS.mdpackages/debug/src/__tests__/history.test.tspackages/debug/src/index.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
Signed-off-by: KayanoLiam <[email protected]>
358fe2f to
318fd09
Compare
|
Hi, just a friendly ping. This PR is ready for review whenever you have a chance. Happy to address any feedback |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
wmadden-electric
left a comment
There was a problem hiding this comment.
Thank you, this is exactly the fix the issue suggested. I merged v7 in and removed the unrelated AGENTS.md edit.
Summary
Fixes #30494
[Object]Validation
Scope
v7as requested in the issueSummary by CodeRabbit
Bug Fixes
Documentation