fix: Remove Snaps Methods from 'methodsWithConfirmation' list used to determine whether to enqueue a request #24371
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently Snaps can call RPC requests that do not fully conform to certain expectation built into the
QueuedRequestController
.wallet_invokeSnap
andwallet_snap
may some times cause a confirmation and in some cases they may not. Currently our blanket assumption that a method either does or does not involve a confirmation is causing an issue:wallet_invokeSnap
can call (as does JSON-RPC Snap on the Test-Snaps Page) another JSON-RPC method upon which it relies for completion. In the queuing system the second request gets queued behind the first (which depends on it for its own execution) leading to a lock up.We should resolve this issue with a more elegant solution for how these chained RPC requests should be handled by queueing. But for now it's safe to simply circumvent queueing for these Snaps methods: In the cases where there is a confirmation resulting from a
wallet_invokeSnap
orwallet_snap
call these requests will simply not be separated from a batch with another origin, which is fine.Related issues
Fixes: See this Slack thread
Manual testing steps
Invoke Snap
on JSON-RPC SnapInvoke Snap
buttonScreenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist