-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
fix(notifications): Ensure notifications feature is disabled/hidden when no basic functionality #25070
fix(notifications): Ensure notifications feature is disabled/hidden when no basic functionality #25070
Conversation
… NOTIFY-724-hide-notifications-when-basic-functionality-is-disabled
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. |
… NOTIFY-724-hide-notifications-when-basic-functionality-is-disabled
this disabled the profile sync button and also shows some warning text for users that basic functionality is required for profile syncing
flexDirection={FlexDirection.Row} | ||
alignItems={AlignItems.center} | ||
justifyContent={JustifyContent.spaceBetween} | ||
{basicFunctionality && ( |
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.
We are hiding notifications when basic functionality is disabled. We can rethink this in a future PR to re-engage users to notifications.
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.
Yes, I agree. I'm not a big fan of the idea of completely hiding the functionality. It might be more interesting to follow the flow used for notifications: if the user wants to enable profile sync and basic functionality is turned off, then show a modal that informs the user that to enable profile sync, basic functionality must also be enabled. By clicking the button on the modal, we can cascade the turning on of basic functionality, authentication, and profile sync.
setIsProfileSyncingEnabled(false); | ||
} | ||
}, [basicFunctionality, setIsProfileSyncingEnabled]); | ||
} | ||
|
||
const ProfileSyncToggle = () => { |
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.
(Prith Note) this is a little annoying, we have basically 2 of the same toggles. 1 for Onboarding, and another here. I wish we could use the same component (but I understand the use-case/logic is different.)
… NOTIFY-724-hide-notifications-when-basic-functionality-is-disabled
Builds ready [5fa3bb7]
Page Load Metrics (52 ± 4 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
privacy-snapshot.json
Outdated
@@ -49,5 +49,6 @@ | |||
"authentication.api.cx.metamask.io", | |||
"oidc.api.cx.metamask.io", | |||
"price.api.cx.metamask.io", | |||
"token.api.cx.metamask.io" | |||
"token.api.cx.metamask.io", | |||
"sepolia.infura.io" |
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.
Ran the vault tests locally to make sure onboarding is okay. Needed to update the snapshot to include sepolia. Is this intended? (@MetaMask/notifications we do not touch any network logic)
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.
Vault Test: yarn test:e2e:single test/e2e/vault-decryption-chrome.spec.js --browser=chrome
, this flow turns off basic functionality so wanted to make sure the new fix/changes worked as expected.
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.
I don't think this should be needed. You should be able to remove this change and this PR's build will still pass.
await driver.clickElement( | ||
'[data-testid="profile-sync-toggle"] .toggle-button', | ||
); | ||
await driver.clickElement('[data-testid="submit-button"]'); | ||
|
||
await Promise.all( | ||
( | ||
await driver.findClickableElements( | ||
'.toggle-button.toggle-button--on:not([data-testid="basic-functionality-toggle"] .toggle-button):not([data-testid="profile-sync-toggle"] .toggle-button)', |
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.
We do not need this e2e setup for onboarding.
Context: This helper goes through onboarding without basic functionality (no additional APIs), and thus also turned off profile syncing. However now we automatically turn off this feature when basic functionality is disabled.
… NOTIFY-724-hide-notifications-when-basic-functionality-is-disabled
… NOTIFY-724-hide-notifications-when-basic-functionality-is-disabled
Builds ready [9337e69]
Page Load Metrics (252 ± 291 ms)
Bundle size diffs
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #25070 +/- ##
===========================================
+ Coverage 65.64% 65.66% +0.02%
===========================================
Files 1362 1362
Lines 54189 54210 +21
Branches 14112 14119 +7
===========================================
+ Hits 35572 35594 +22
+ Misses 18617 18616 -1 ☔ View full report in Codecov by Sentry. |
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.
Great work. Just one comment for future development. Other than that, it’s super okay for me
flexDirection={FlexDirection.Row} | ||
alignItems={AlignItems.center} | ||
justifyContent={JustifyContent.spaceBetween} | ||
{basicFunctionality && ( |
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.
Yes, I agree. I'm not a big fan of the idea of completely hiding the functionality. It might be more interesting to follow the flow used for notifications: if the user wants to enable profile sync and basic functionality is turned off, then show a modal that informs the user that to enable profile sync, basic functionality must also be enabled. By clicking the button on the modal, we can cascade the turning on of basic functionality, authentication, and profile sync.
privacy-snapshot.json
Outdated
@@ -49,5 +49,6 @@ | |||
"authentication.api.cx.metamask.io", | |||
"oidc.api.cx.metamask.io", | |||
"price.api.cx.metamask.io", | |||
"token.api.cx.metamask.io" | |||
"token.api.cx.metamask.io", | |||
"sepolia.infura.io" |
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.
I don't think this should be needed. You should be able to remove this change and this PR's build will still pass.
… NOTIFY-724-hide-notifications-when-basic-functionality-is-disabled
we don't actually need this change (CI passes without it)
… NOTIFY-724-hide-notifications-when-basic-functionality-is-disabled
Builds ready [b296851]
Page Load Metrics (50 ± 3 ms)
Bundle size diffs
|
@danjm yep you are correct, we do not need to update the privacy snapshot. Reverted the snapshot change. |
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.
I approve again!
Description
This ensures that our feature is fully disabled when the basic functionality is disabled.
This is mostly a Hot-Fix, and a more structured UX/UI will be available once discussed with design and product.
Related issues
Fixes: The current Profile Syncing Feature doesn't fully respect Basic Functionality when turned off. This ensures that the notifications feature and profile syncing are actually turned off when Basic Functionality if off.
Manual testing steps
Screenshots/Recordings
Before
After
Updated/Fixed Onboarding flow for Basic Functionality + Profile Syncing
See vid
Pre-merge author checklist
Pre-merge reviewer checklist