-
-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: assign a UUID
to all BaseProvider
requests
#399
Conversation
uuid
to all BaseProvider requests
uuid
to all BaseProvider requestsuuid
to all BaseProvider requests
uuid
to all BaseProvider requestsUUID
to all BaseProvider requests
UUID
to all BaseProvider requestsUUID
to all BaseProvider
requests
Removed dependencies detected. Learn more about Socket for GitHub ↗︎ 🚮 Removed packages: npm/@types/[email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised that this hasn't caused a problem so far, but seems like a good idea? Curious to know what others think.
@@ -208,9 +209,11 @@ export abstract class BaseProvider extends SafeEventEmitter { | |||
const payload = | |||
params === undefined || params === null | |||
? { | |||
id: uuidV4(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Do we want to do this in _rpcRequest
? I see that we already provide a default value for jsonrpc
if it's not given so it seems like this check for id
may belong there too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More importantly, can we add a test for this?
The PR was closed because this functionality should be managed by using an rpc middleware in the rpcMiddleware param available in providers, such as createIdRemapMiddleware, here: https://github.com/MetaMask/providers/blob/main/src/StreamProvider.ts#L58. |
This PR assigns a UUID to all
BaseProvider
requests.