Skip to content

fix: reject primitive RPC responses without retrying - #2

Draft
1932819331hy-debug wants to merge 1 commit into
workolic:mainfrom
1932819331hy-debug:fix/rpc-response-shape
Draft

1932819331hy-debug wants to merge 1 commit into
workolic:mainfrom
1932819331hy-debug:fix/rpc-response-shape

Conversation

@1932819331hy-debug

Copy link
Copy Markdown

Summary

 HTTP 200 with a truthy JSON primitive envelope
- TypeError -> transport retries -> RpcError
+ RpcShapeError, without retrying

Add an object-type guard before checking for result, restoring the existing unreadable-response contract. Valid results, including null, explicit RPC errors and transient transport retries keep their behavior. Only src/rpc.js and a focused regression file change.

Evidence

  • Before: the new native regression suite has 14 passes / 3 failures on main 13184ff111532c172f37d54d59f00e7eea6b9a23.
    After: all 17 pass; native npm test passes 40/40.
  • Independent AI-assisted review: 47/47 protocol cases pass, and four deliberately broken variants are caught by the new tests alone.
  • Local composition with fix: reject unsafe schedule block counts before projection #1 passes 50/50. Both patch orders produce the same full tree; its branch and scope are unchanged.
  • Node 24.22.1, native JSON decoding and injected synthetic transport only. No dependency installation or live-provider requests. Node 18/20/22, other operating systems and hosted CI remain unverified.

This is a source-backed contract repair, not completion of a separate maintainer issue. AI assistance was used for implementation, testing and review.

Merge Danger

Door: Two-way. One production guard, with no migration.

Blast Radius: RPC.

Malformed truthy primitive responses now stop immediately rather than being retried. JSON parse-error and broader retry policies are unchanged.

Signed-off-by: 1932819331hy-debug <343001481+1932819331hy-debug@users.noreply.github.com>
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