Skip to content

fix(rpc): encode defects with Schema.Defect in sendRequestDefect and sendDefect#6055

Merged
tim-smart merged 1 commit intoEffect-TS:mainfrom
marbemac:fix/6054-encode-error-serialization
Feb 12, 2026
Merged

fix(rpc): encode defects with Schema.Defect in sendRequestDefect and sendDefect#6055
tim-smart merged 1 commit intoEffect-TS:mainfrom
marbemac:fix/6054-encode-error-serialization

Conversation

@marbemac
Copy link
Contributor

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Error objects have non-enumerable properties (message, stack, name), so JSON.stringify produces {} and all error information is lost on the client. Use Schema.encodeSync(Schema.Defect) to properly serialize defects, matching the encoding already used in exitSchema and RpcMessage.ResponseDefectEncoded.

Related

…sendDefect

Error objects have non-enumerable properties (message, stack, name), so
JSON.stringify produces {} and all error information is lost on the client.
Use Schema.encodeSync(Schema.Defect) to properly serialize defects, matching
the encoding already used in exitSchema and RpcMessage.ResponseDefectEncoded.

Fixes Effect-TS#6054

Signed-off-by: Marc MacLeod <marbemac+gh@gmail.com>
@marbemac marbemac requested a review from tim-smart as a code owner February 12, 2026 17:14
@github-project-automation github-project-automation bot moved this to Discussion Ongoing in PR Backlog Feb 12, 2026
@changeset-bot
Copy link

changeset-bot bot commented Feb 12, 2026

🦋 Changeset detected

Latest commit: 656f62d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@effect/rpc Patch
@effect/cluster Patch
@effect/platform-bun Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/workflow Patch
@effect/ai Patch
@effect/sql-clickhouse Patch
@effect/ai-amazon-bedrock Patch
@effect/ai-anthropic Patch
@effect/ai-google Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

tim-smart added a commit to Effect-TS/effect-smol that referenced this pull request Feb 12, 2026
@tim-smart tim-smart enabled auto-merge (squash) February 12, 2026 21:15
@tim-smart tim-smart merged commit 598ff76 into Effect-TS:main Feb 12, 2026
11 checks passed
@github-project-automation github-project-automation bot moved this from Discussion Ongoing to Done in PR Backlog Feb 12, 2026
@github-actions github-actions bot mentioned this pull request Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[RPC] sendRequestDefect bypasses Schema.Defect encoding, causing defect details to be lost on the client

2 participants