Closed danjm closed 1 week ago
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.
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 57 | 138 | 81 | 22 | 11 |
domContentLoaded | 8 | 46 | 15 | 12 | 6 | ||
load | 45 | 3017 | 564 | 1017 | 488 | ||
domInteractive | 8 | 46 | 15 | 12 | 6 |
Missing release label release-11.15.2 on PR. Adding release label release-11.15.2 on PR and removing other release labels(release-11.18.0), as PR was cherry-picked in branch 11.15.2.
Description
This fixes a bug I found while testing v11.15.1. The bug is that currently only new users will see the "Enable Smart Transactions" modal. People who already have metamask installed and then update to v11.15.1 will not see the "Enable Smart Transactions" modal. This means that existing users won't be notified that they can turn this functionality on.
The reason is that
getIsSmartTransactionsOptInModalAvailable
only returns true if the result ofgetSmartTransactionsOptInStatus(state)
isnull
. That depends on thesmartTransactionsOptInStatus
property, from the preferences controller. That property is set within thepreferencesController.preferences
property, which is an object, withininitState
of the the preferences controller.initState
is always over written by pre-existing state if it existis (via the...opts.initState,
line). If a user is updating to v11.15.1 from a previous version,preferencesController.preferences
from the previous version will overwrite the defaultpreferencesController.preferences
, and sosmartTransactionsOptInStatus
will beundefined
(and notnull
).The simple fix applied here is for
getSmartTransactionsOptInStatus
to returnnull
ifsmartTransactionsOptInStatus
is undefined.Manual testing steps
Follow the above 3 steps on
develop
or onVersion-v11.15.1
, and there will be no modal shown on step three.Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist