Repository navigation
refactor(bindings): centralize wire decoding in Rust - #249
Conversation
SummarySolid refactor: it centralizes evaluate-wire decoding in Rust (a 🔴 Critical Issues (0)None found. I specifically checked whether the new recursive 🟡 Suggestions (2)
📝 Minor / Style (2)
|
andrewneilson
left a comment
There was a problem hiding this comment.
Reviewed the decoding refactor and binding call sites. Found one compatibility regression in Error leaf parsing, detailed inline. Verified the serializer output and previous Node coercion with a focused reproduction; native tests were not run locally because the Rust toolchain and compiled addons are unavailable. This PR is already merged, so this is a comment review.
| _ => None, | ||
| }) | ||
| .ok_or_else(|| { | ||
| RwError::InvalidInput(format!("wire error field must be a string: {name}")) |
There was a problem hiding this comment.
[P2] Preserve coercion of customized Error metadata
The serializer still emits item.name || "Error", item.message || "", and item.stack || "" without converting them to strings, so this validation rejects values the core itself produces. For example, page.evaluate(() => { const e = new Error("boom"); e.name = 123; return e; }) now fails with wire error field must be a string: name in both Python and Node; previously the adapters returned an Error with the name coerced to "123". An object-valued custom stack has the same problem. Preserve the existing native coercion policy for these fields, or make the serializer/parser contract consistent without losing that behavior, and add a regression covering customized Error metadata.
https://github.com/Skyvern-AI/rustwright-cloud/pull/232