Skip to content

Conversation

@FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented May 15, 2025

Stop storing an RPC handler in the runtime for Snaps, instead just move the handler code directly to handleRequest. Also removes the RequestQueue previously used during the Snap starting up, instead we let as many requests as needed wait for startPromise. This simplifies RPC request routing significantly.

Recommend reviewing this with whitespace changes not displayed 😄

@FrederikBolding FrederikBolding force-pushed the fb/simplify-controller-rpc branch from f5a49ff to 9f713d1 Compare May 16, 2025 08:33
@codecov
Copy link

codecov bot commented May 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.14%. Comparing base (b0b5264) to head (6df8fb0).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3397      +/-   ##
==========================================
+ Coverage   98.13%   98.14%   +0.01%     
==========================================
  Files         400      399       -1     
  Lines       11027    10990      -37     
  Branches     1738     1729       -9     
==========================================
- Hits        10821    10786      -35     
+ Misses        206      204       -2     

☔ 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 force-pushed the fb/simplify-controller-rpc branch from 9f713d1 to dff1689 Compare May 21, 2025 10:02
@FrederikBolding FrederikBolding marked this pull request as ready for review May 21, 2025 10:02
@FrederikBolding FrederikBolding requested a review from a team as a code owner May 21, 2025 10:02
@FrederikBolding FrederikBolding force-pushed the fb/simplify-controller-rpc branch from dff1689 to 6df8fb0 Compare May 22, 2025 12:00
const result = await withTimeout(handleRpcRequestPromise, timer);

if (result === hasTimedOut) {
throw new Error(`${snapId} failed to respond to the request in time.`);
Copy link
Member

Choose a reason for hiding this comment

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

Nit:

Suggested change
throw new Error(`${snapId} failed to respond to the request in time.`);
throw new Error(`Snap "${snapId}" failed to respond to the request in time.`);

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Preferably we update those too, but fine with me to do in a separate PR as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

IMO out of scope then 😄

@FrederikBolding FrederikBolding added this pull request to the merge queue May 22, 2025
Merged via the queue into main with commit cdb36fa May 22, 2025
117 checks passed
@FrederikBolding FrederikBolding deleted the fb/simplify-controller-rpc branch May 22, 2025 12:19
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