Skip to content

bugfix: provider stop#177

Merged
estebanmino merged 5 commits intodevelopfrom
bugfix/provider-stop
Nov 11, 2019
Merged

bugfix: provider stop#177
estebanmino merged 5 commits intodevelopfrom
bugfix/provider-stop

Conversation

@estebanmino
Copy link
Contributor

There is a bug happening between stopping the provider listener and setting a new provider.

By doing
https://github.com/MetaMask/gaba/compare/bugfix/provider-stop?expand=1#diff-e6a23ff500e4183b5eba5bca9a0df0bdL136
we're unsubscribing the provider to handle errors from
https://github.com/MetaMask/gaba/compare/bugfix/provider-stop?expand=1#diff-e6a23ff500e4183b5eba5bca9a0df0bdL101
causing that we have an active provider exposed to throwable errors without handling it properly.

This PR sets a threshold to stop it after a new provider is set, to make sure that we're not exposed to errors coming from the provider.

@estebanmino
Copy link
Contributor Author

it will fix MetaMask/metamask-mobile#1171

@codecov-io
Copy link

codecov-io commented Nov 6, 2019

Codecov Report

Merging #177 into develop will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           develop   #177   +/-   ##
======================================
  Coverage      100%   100%           
======================================
  Files           23     23           
  Lines         1512   1514    +2     
  Branches       210    210           
======================================
+ Hits          1512   1514    +2
Impacted Files Coverage Δ
src/network/NetworkController.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 927181e...2e7dc2c. Read the comment docs.

Copy link
Contributor

@brunobar79 brunobar79 left a comment

Choose a reason for hiding this comment

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

LGTM!

@estebanmino estebanmino merged commit 8677333 into develop Nov 11, 2019
@estebanmino estebanmino deleted the bugfix/provider-stop branch November 11, 2019 16:02
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* late provider stop

* fix

* rename to safelyStopProvider
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* late provider stop

* fix

* rename to safelyStopProvider
Mrtenz pushed a commit that referenced this pull request Oct 16, 2025
* Refactor cache helper methods

Refactor cache helper methods to no longer use the `Payload` type to
access the request method. Instead they now take the method directly.

This relates to #176, in that it reduces the number of places where we
are using this `Payload` type that we need to eliminate for #176.

* Add docs and tests

* Add canCache refactor
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