Skip to content

chore: Use JsonRpcEngineV2 for execution services#3857

Merged
FrederikBolding merged 1 commit intomainfrom
fb/use-json-rpc-engine-v2-in-services
Feb 16, 2026
Merged

chore: Use JsonRpcEngineV2 for execution services#3857
FrederikBolding merged 1 commit intomainfrom
fb/use-json-rpc-engine-v2-in-services

Conversation

@FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Feb 16, 2026

Use JsonRpcEngineV2 for execution service communication. This is one of the very few pieces of the JSON-RPC pipeline that we have full control over. The rest of the migration is nested in other libraries.


Note

Medium Risk
Changes the internal Snap command RPC pipeline and error propagation semantics; regressions could impact Snap startup/termination and request handling, though the surface area is limited to execution-service communication.

Overview
Switches AbstractExecutionService’s command-channel JSON-RPC engine from @metamask/json-rpc-engine to JsonRpcEngineV2, constructing the engine via JsonRpcEngine.create and wrapping the existing stream middleware with asV2Middleware.

Updates the stored rpcEngine type to be request-typed and simplifies #command to return rpcEngine.handle(...) directly, removing the prior manual JSON-RPC error unwrapping/throwing logic.

Written by Cursor Bugbot for commit c7c4a4b. This will update automatically on new commits. Configure here.

@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.58%. Comparing base (7e0c761) to head (c7c4a4b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3857      +/-   ##
==========================================
- Coverage   98.59%   98.58%   -0.01%     
==========================================
  Files         429      429              
  Lines       12416    12411       -5     
  Branches     1928     1927       -1     
==========================================
- Hits        12241    12236       -5     
  Misses        175      175              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@FrederikBolding FrederikBolding marked this pull request as ready for review February 16, 2026 14:36
@FrederikBolding FrederikBolding requested a review from a team as a code owner February 16, 2026 14:36
// We don't need full validation of the response here because we control it.
if (hasProperty(response, 'error')) {
const error = response.error as JsonRpcErrorType;
throw new JsonRpcError(error.code, error.message, error.data);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not need this anymore?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FrederikBolding FrederikBolding added this pull request to the merge queue Feb 16, 2026
Merged via the queue into main with commit 9546e20 Feb 16, 2026
130 checks passed
@FrederikBolding FrederikBolding deleted the fb/use-json-rpc-engine-v2-in-services branch February 16, 2026 14:42
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.

2 participants