Skip to content

Fix 10036 - Prevent odd localStorage migration error in Firefox#10884

Merged
darkwing merged 1 commit intoMetaMask:developfrom
darkwing:10036-localstorage-migration
Apr 14, 2021
Merged

Fix 10036 - Prevent odd localStorage migration error in Firefox#10884
darkwing merged 1 commit intoMetaMask:developfrom
darkwing:10036-localstorage-migration

Conversation

@darkwing
Copy link
Contributor

Fixes: #10036

Explanation:

This is a weird one -- the only hint I can find is: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Privacy/Storage_access_policy, though it cites the error having been removed in Firefox 70, yet we're seeing the error happen in up to Firefox 84.

That said, we've only seen this happen 16 times in Firefox since January 2021, and it's for a "cleanup" migration with no other side effect than old cached data in a structure we're no longer using.

I think a window.localStorage check here would suffice.

@darkwing darkwing requested a review from a team as a code owner April 14, 2021 13:49
@darkwing darkwing requested a review from NiranjanaBinoy April 14, 2021 13:49
@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

I too have noticed that the compatibility tables on MDN for some APIs seem to contradict the Sentry errors we get.

@darkwing darkwing merged commit fc30fd4 into MetaMask:develop Apr 14, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: MetaMask Migration Error #50: window.localStorage is null

2 participants