Skip to content

fix(jq): format runtime errors without value dumps - #1488

Merged
chaliy merged 1 commit into
mainfrom
fix/jq-runtime-error-formatting
Apr 30, 2026
Merged

chaliy merged 1 commit into
mainfrom
fix/jq-runtime-error-formatting

Conversation

@chaliy

@chaliy chaliy commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

What

Format jq runtime errors with bounded, jq-like diagnostics instead of jaq/Rust debug dumps that include full input values.

Why

Runtime jq failures such as array field typos could emit the entire offending JSON value to stderr, creating huge unreadable output and potential data leakage.

How

  • Unwrap jaq runtime errors into displayable errors before formatting.
  • Summarize structured value-bearing errors for index, type/iteration, math, and path-expression failures.
  • Cap unstructured runtime error output.
  • Add regression tests covering large-value error cases and jq-like wording.

Risk

  • Low
  • Affects jq runtime stderr text only; jq stdout, exit code, and filter semantics are unchanged.

Checklist

  • Tests added or updated
  • Backward compatibility considered

Fixes #1487

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Apr 30, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 4442054 Commit Preview URL

Branch Preview URL
Apr 30 2026, 05:32 AM

@chaliy
chaliy merged commit a8452a1 into main Apr 30, 2026
34 checks passed
@chaliy
chaliy deleted the fix/jq-runtime-error-formatting branch April 30, 2026 05:43
@codecov

codecov Bot commented Apr 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

bug(jq): runtime errors leak full input value as Rust Debug dump (stderr scales with input size)

1 participant