-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Phishing controller test method should be async and it should not poll #897
Conversation
43dfbe0
to
0339ff9
Compare
0339ff9
to
1d528db
Compare
1d528db
to
7d19ac1
Compare
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.
Thanks for doing this! Left some comments below — mostly minor, but did want to see if we could make lastFetched
private instead of public.
7d19ac1
to
2078cba
Compare
edb1620
to
8490c79
Compare
@mcmire I've updated |
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.
This looks good to me!
@mcmire bump! |
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!
Hmm. This might significantly slow down the phishing check when a page loads. The check is already made asynchronously, with the suspicious page sometimes loading partially before we have a chance to redirect to the warning page. I'll test this out to see what it looks like in practice. Maybe there are ways to check sooner in the navigation process. |
In testing, the slowdown is noticeable but barely. It doesn't seem appreciably different from before as far as I can tell. Before and after, there is a flash of the page rendering before redirect. It'll be a bit difficult to manage this on the extension side because we normally check the phishing list just prior to setting up the RPC pipeline. If this is async, we'll need to continue to setup the pipeline without waiting (so we don't drop requests send during page load), but we won't want to process these requests until after the result returns. But that's fine, we can do that. |
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!
I went ahead with merging this myself so that it could be included in the v31 release |
#897) * Changed phishing controller interface to be async and not have polling * fixed PR review issues * Fixed linting issues in PhishingController test * Removed fetching phishing list before bypass function body * Added period to the end of param jsdoc Co-authored-by: Shane Jonas <jonas.shane@gmail.com>
#897) * Changed phishing controller interface to be async and not have polling * fixed PR review issues * Fixed linting issues in PhishingController test * Removed fetching phishing list before bypass function body * Added period to the end of param jsdoc Co-authored-by: Shane Jonas <jonas.shane@gmail.com>
PR Title
problems:
test
depends onstate.whitelist
which is set async viapoll
>updatePhishingLists
. It is a sync function, which creates race conditions.solution:
Description
BREAKING:
phishingController.test
now returns aPromise<EthPhishingDetectResult>
phishingController.setRefreshInterval
orphishingController.configure({ refreshInterval: 123 })
(configure will be deprecated when we switch to using BaseController V2)FIXED:
Checklist
Issue
Resolves #???