Skip to content

Fix/6288 procedure rejection error - #6382

Closed
rohanranjan0902 wants to merge 3 commits into
clockworklabs:masterfrom
rohanranjan0902:fix/6288-procedure-rejection-error
Closed

rohanranjan0902 wants to merge 3 commits into
clockworklabs:masterfrom
rohanranjan0902:fix/6288-procedure-rejection-error

Conversation

@rohanranjan0902

Copy link
Copy Markdown
Contributor

Description of Changes

Procedure failures were rejected as plain strings, unlike reducer failures, which reject with Error instances. Wrap procedure failures in InternalError in both callback paths so callers get an error object with a message and stack trace, and matchers such as .rejects.toThrow(...) work.

Also preserve row parsing for existing FixedSize(0) fixtures and correct the row-offset test fixture to use a bigint.

API and ABI breaking changes

No API or ABI breaking changes.

Expected complexity level and risk

1/5 — Small SDK error-handling change with regression coverage.

…lockworklabs#5841)

When a previous test panics while compiling a module, the cache Mutex
becomes poisoned. This replaces .unwrap() with .unwrap_or_else() to
recover the lock, ensuring subsequent tests surface their actual
underlying errors rather than failing with a cascade of generic PoisonErrors.
@xanadinn

Copy link
Copy Markdown

Looks good. Clanker did point out one potential issue:
OutOfEnergy gets a useless message. The ProcedureResult handler maps every non-Returned status to {tag: 'Err', value: status.value}. For OutOfEnergy that value isn't a string, so the new code builds an InternalError whose message is "undefined" or "[object Object]". Map each status explicitly, for example OutOfEnergy to "procedure ran out of energy".

@rohanranjan0902

Copy link
Copy Markdown
Contributor Author

I checked the TypeScript SDK’s negotiated protocols: it supports v2/v3, where out-of-energy failures are sent as InternalError strings. The separate OutOfEnergy variant is in the v1 protocol, which this SDK does not negotiate. I have left the v2/v3 status decoding unchanged to avoid changing its enum tag mapping.

Signed-off-by: Rohan Ranjan Prasad <149056080+rohanranjan0902@users.noreply.github.com>
@bfops

bfops commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Closing in favor of #6349, which addresses the same procedure-error handling bug with a focused change and regression coverage. The additional row-decoding changes in this PR need separate review; please propose those independently if they are still needed. Thanks for the contribution!

@bfops bfops closed this Nov 18, 2026
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.

3 participants