-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
Passing configuration options to JSON stream middleware #223
Conversation
It looks like the new version of |
PR is blocked by #225 |
@@ -71,7 +71,9 @@ export abstract class AbstractStreamProvider extends BaseProvider { | |||
); | |||
|
|||
// Set up RPC connection | |||
this._jsonRpcConnection = createStreamMiddleware(); | |||
this._jsonRpcConnection = createStreamMiddleware({ | |||
retryOnMessage: 'METAMASK_EXTENSION_STREAM_CONNECT', |
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.
Where is this message sent? Just trying to understand the whole solution.
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.
The message is sent from contentScript when extension stream is connected https://github.com/MetaMask/metamask-extension/blob/develop/app/scripts/contentscript.js#L395
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.
LGTM!
PR should be merged only after MetaMask/json-rpc-middleware-stream#27 is deployed.
json-rpc-middleware-stream
takes care to replay DAPP action when reconnection message is received. This PR passes the configuration parameter for the replay message injson-rpc-middleware-stream
.