Make sure to load a fresh copy of the phishing configuration#297
Make sure to load a fresh copy of the phishing configuration#297danfinlay merged 4 commits intoMetaMask:developfrom
Conversation
Gudahtt
left a comment
There was a problem hiding this comment.
Wouldn't this always skip the cache? Not just upon initialization, but on every request.
It seems that the default cache mode used here is no-cache, which already seems ideal here. From the MDN docs:
The browser looks for a matching request in its HTTP cache.
- If there is a match, fresh or stale, the browser will make a conditional request to the remote server. If the server indicates that the resource has not changed, it will be returned from the cache. Otherwise the resource will be downloaded from the server and the cache will be updated.
- If there is no match, the browser will make a normal request, and will update the cache with the downloaded resource.
This should guarantee that we're getting an up-to-date copy, even if there is a cached copy.
|
Closing per @Gudahtt's feedback. |
This update comes with a breaking change to the Approval controller. It now requires a `defaultApprovalType` parameter. I don't think we have any use for a default approval type, but I've added a "NO_TYPE" one for now because it's a strict requirement. We should consider making this parameter optional in the future, for cases like this where it's not needed. This update will hopefully address some caching issues we've been seeing with our phishing configuration. See here for more details: MetaMask/core#297
|
It seems I was mistaken about the default behaviour. By default The change made in this PR (using cache mode Note that even with this change, the phishing config is still cached for long periods on the server. This will only prevent stale client caches. But it's a start! |
This update comes with a breaking change to the Approval controller. It now requires a `defaultApprovalType` parameter. I don't think we have any use for a default approval type, but I've added a "NO_TYPE" one for now because it's a strict requirement. We should consider making this parameter optional in the future, for cases like this where it's not needed. This update will hopefully address some caching issues we've been seeing with our phishing configuration. See here for more details: MetaMask/core#297
This update comes with a breaking change to the Approval controller. It now requires a `defaultApprovalType` parameter. I don't think we have any use for a default approval type, but I've added a "NO_TYPE" one for now because it's a strict requirement. We should consider making this parameter optional in the future, for cases like this where it's not needed. This update will hopefully address some caching issues we've been seeing with our phishing configuration. See here for more details: MetaMask/core#297
This update comes with a breaking change to the Approval controller. It now requires a `defaultApprovalType` parameter. I don't think we have any use for a default approval type, but I've added a "NO_TYPE" one for now because it's a strict requirement. We should consider making this parameter optional in the future, for cases like this where it's not needed. This update will hopefully address some caching issues we've been seeing with our phishing configuration. See here for more details: MetaMask/core#297
* Make sure to load a fresh copy of the configuration * Update src/third-party/PhishingController.ts * Update src/third-party/PhishingController.ts Co-authored-by: Dan Finlay <542863+danfinlay@users.noreply.github.com>
* Make sure to load a fresh copy of the configuration * Update src/third-party/PhishingController.ts * Update src/third-party/PhishingController.ts Co-authored-by: Dan Finlay <542863+danfinlay@users.noreply.github.com>
I've noticed that the phishing configuration could be fetched from the disk cache in Chrome due to the initial cache policy when it's fetched for the first time - this makes sure that polling will be done over the network to have a fresh copy.