Skip to content

fix(logging): name the driver cause and redact bound params in logged errors - #8565

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/deployed-state-log-noise-and-db-error-cause
Oct 2, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
fix/deployed-state-log-noise-and-db-error-cause

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Logger now redacts Drizzle's \nparams: <values> tail from a logged error's message and stack (and the OTel export) — bound values are user data and were reaching every DB error log line
  • Logger adds errorCause / errorCode from the deepest .cause, so a wrapped DrizzleQueryError names the real reason (statement timeout, constraint violation) instead of only the failing SQL
  • loadDeployedWorkflowState no longer logs NoActiveDeploymentError at ERROR — an undeployed workflow is an outcome every caller already handles (custom-block input derivation returns [], read models return null, executions fail the run with their own log). Real load failures still log
  • Reuses describeError / redactBoundParameters from @sim/utils/errors; error stays a plain message string so log grouping is unchanged

Type of Change

  • Bug fix

Testing

  • New wrapped driver errors cases in packages/logger/src/index.test.ts (bare error, { error }, other key, OTel export, unwrapped negative control); each written first and shown red on the pre-fix logger, and each guard reverted individually to confirm its test fails
  • bun run test (all workspaces green; one unrelated CPU-timeout in remark-plain-text.test.ts under full-suite load passes in isolation)
  • bun run type-check in packages/logger and apps/sim, bun run lint, check-block-registry, bun run check:audits, docs-manifest:check

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Oct 2, 2026 8:52am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Improves error logging for database query failures.

The PR appears safe to merge; no new actionable issue or outstanding previous finding remains.

Summary

The PR redacts Drizzle bound parameters from console and OTel error logs, adds the deepest driver cause and code to diagnostics, and avoids logging an expected undeployed-workflow outcome as an error.

  • The changes since the previous review align cause fields with the last bare error argument and add a regression test.

Reviews (3) · Last reviewed commit: "fix(logging): report the cause of the er..."

Comment thread packages/logger/src/index.ts
Comment thread packages/logger/src/index.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread packages/logger/src/index.ts
Comment thread packages/logger/src/index.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread packages/logger/src/index.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit af88862 into staging Oct 2, 2026
36 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/deployed-state-log-noise-and-db-error-cause branch October 2, 2026 15:34

This branch was successfully deployed

1 active deployment
Preview — b47175cc Deployed Oct 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant