Skip to content

Preserve falsy response values in JSON-RPC traces - #1949

Merged
Dirk Bäumer (dbaeumer) merged 2 commits into
microsoft:mainfrom
pradeep-ramola:fix/trace-falsy-response-values
Nov 30, 2026
Merged

Dirk Bäumer (dbaeumer) merged 2 commits into
microsoft:mainfrom
pradeep-ramola:fix/trace-falsy-response-values

Conversation

@pradeep-ramola

Copy link
Copy Markdown
Contributor

Verbose and compact text traces currently treat false, 0, and empty-string results as missing, reporting "No result returned." They also omit those values when supplied as error data. Both sending and receiving response traces use truthiness checks.

Replace these with explicit null/undefined checks. Existing null-result and null-error-data behavior is unchanged, as are JSON traces and the wire protocol.

Add 16 round-trip regression cases covering both trace levels, both response directions, successful results and error data, including null compatibility checks. The falsy-value cases failed before the implementation change.

Validation:

  • npm run compile:jsonrpc
  • npm --prefix jsonrpc run lint
  • npm --prefix jsonrpc run test:node (95 passing)
  • git diff --check

Browser and VS Code integration tests were not run.

Copilot AI balanced review requested due to automatic review settings November 22, 2026 02:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are identified for the change preserving falsy values in JSON-RPC text traces.

No open issues 🎉

What changed in this PR

Fixes JSON-RPC text tracing so false, 0, and empty-string response values are preserved without changing null handling, JSON traces, or the wire protocol.

Changes:

  • Replaces truthiness checks with explicit null/undefined checks for results and error data in both response directions.
  • Adds 16 round-trip regression cases covering Verbose and Compact traces, falsy values, and null compatibility.
File Description
jsonrpc/​src/​node/​test/​connection.test.ts Adds regression coverage for sent and received response traces.
jsonrpc/​src/​common/​connection.ts Preserves falsy results and error data in text trace output.

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the change preserving falsy values in JSON-RPC text response traces.

No open issues 🎉

Review effort: Balanced

@dbaeumer
Dirk Bäumer (dbaeumer) merged commit 927db66 into microsoft:main Nov 30, 2026
4 checks passed
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.

4 participants