Skip to content
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: cp-7.42.0 improve performance of notifications loading when opening the app #13803

Merged
merged 4 commits into from
Mar 3, 2025

Conversation

Prithpal-Sooriya
Copy link
Contributor

@Prithpal-Sooriya Prithpal-Sooriya commented Mar 3, 2025

Description

There is serious performance impact of loading notifications on startup. It is roughly a 2 second lag, and the app freezes during this process.
This is due to us processing the encryption key to be used for decrypting entries in UserStorage.
This persists the a cached encryption key using existing storage mechanisms to securely store this hashed key.

NOTE: This fix is an interim solution until we add e2e content keys for encryption (CC @mathieuartu @mirceanis)
MetaMask/core#5129

Related issues

Fixes:

Manual testing steps

  1. Enable Notifications
  2. Close the app
  3. Open the app and unlock the wallet
    EXPECTED - you should not see any lag or app freezing.

Screenshots/Recordings

Before

https://www.loom.com/share/8951a714b9b34f79a3e988ed50f9f656?sid=ad2ff732-c893-49d6-bd4b-e7f13a3a08b5

After

https://www.loom.com/share/fe0afadcd49b46bbbafe219f95777fb6?sid=ca0df6aa-b5c5-4ffd-a5ee-bc811f0f1058

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

github-actions bot commented Mar 3, 2025

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.

@Prithpal-Sooriya Prithpal-Sooriya added the Run Smoke E2E Triggers smoke e2e on Bitrise label Mar 3, 2025
Copy link
Contributor

github-actions bot commented Mar 3, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: ae42f91
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/1f30f7ce-62b8-4581-b868-abb1e521f899

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@Prithpal-Sooriya Prithpal-Sooriya requested a review from a team March 3, 2025 17:51
@Prithpal-Sooriya Prithpal-Sooriya marked this pull request as ready for review March 3, 2025 17:51
@Prithpal-Sooriya Prithpal-Sooriya requested review from a team as code owners March 3, 2025 17:51
mathieuartu
mathieuartu previously approved these changes Mar 3, 2025
Copy link
Contributor

@mathieuartu mathieuartu left a comment

Choose a reason for hiding this comment

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

Thanks for all the context you added in your comments! LGTM!

Also, approving since there may be not enough time to get this directly in the controllers for this release, but the contents of this PR will be replaced soon by an implementation directly in UserStorageController

@Prithpal-Sooriya Prithpal-Sooriya changed the title fix: improve performance of notifications loading when opening the app fix: cp-7.42.0 improve performance of notifications loading when opening the app Mar 3, 2025
@Prithpal-Sooriya Prithpal-Sooriya added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Mar 3, 2025
Copy link
Contributor

github-actions bot commented Mar 3, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 8dedd2b
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/0809392a-80e5-4a3e-81a7-980249b2ed38

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@Prithpal-Sooriya Prithpal-Sooriya added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Mar 3, 2025
Copy link
Contributor

github-actions bot commented Mar 3, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 3fdce4b
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/080019da-3a6d-4eaa-9d55-62c4f121730a

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@Prithpal-Sooriya Prithpal-Sooriya added this pull request to the merge queue Mar 3, 2025
Merged via the queue into main with commit 18f84aa Mar 3, 2025
42 of 43 checks passed
@Prithpal-Sooriya Prithpal-Sooriya deleted the fix/notification-on-start-performance branch March 3, 2025 22:46
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2025
@metamaskbot metamaskbot added the release-7.43.0 Issue or pull request that will be included in release 7.43.0 label Mar 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.43.0 Issue or pull request that will be included in release 7.43.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants