You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ocap-kernel): deserialize CapData rejections in queueMessage RPC handler (#928)
Vat rejections are serialized as CapData objects before leaving the vat
runtime. Previously, callers of Kernel.queueMessage (the RPC handler and
SubclusterManager) each had their own isCapData/kunser call-site patches
to convert them back into plain Errors. Consolidate the deserialization
into Kernel.queueMessage itself so all callers see plain Error objects
without needing individual workarounds.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Changes the error propagation contract of `Kernel.queueMessage` to
unwrap CapData rejections into plain `Error`s, which can affect all
callers and tests that previously inspected serialized rejection shapes.
>
> **Overview**
> **Kernel message errors now surface as plain `Error`s.**
`Kernel.queueMessage()` catches CapData-shaped rejections from the run
queue and deserializes them via `kunser` before throwing, while
non-CapData failures are rethrown unchanged.
>
> This removes duplicate CapData-unwrapping logic from
`SubclusterManager` and updates RPC/unit/e2e/integration tests to assert
`rejects.toThrow(...)` (or regex) instead of matching on a serialized `{
body: ... }` rejection payload. The ocap-kernel changelog is updated to
document the fix.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
b672c99. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Copy file name to clipboardExpand all lines: packages/ocap-kernel/CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
### Fixed
11
+
12
+
- Deserialize CapData rejections in `Kernel.queueMessage` so vat errors surface as plain `Error` objects to all callers ([#928](https://github.com/MetaMask/ocap-kernel/pull/928))
0 commit comments