-
-
Notifications
You must be signed in to change notification settings - Fork 192
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: profile-sync-controller - make fixture constants lazy #4592
fix: profile-sync-controller - make fixture constants lazy #4592
Conversation
this is a temp fix so that mobile does not compute these fixtures are runtime. we do need to support multiple exports to ensure that these are not called.
...ion-services-controller/src/NotificationServicesController/NotificationServicesController.ts
Show resolved
Hide resolved
// NOTE - using encryption.encryptString directly in fixtures causes issues on mobile. | ||
// This is because this fixture is getting added in at run time. Will be improved once we support multiple exports | ||
export const MOCK_ENCRYPTED_STORAGE_DATA = () => | ||
encryption.encryptString(MOCK_STORAGE_DATA, MOCK_STORAGE_KEY); |
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.
As mentioned, mobile has an issue with running this fixture.
This most likely is because our relative imports (barrel files), drag in these fixtures and need to be computed once pulled in.
We will explore multiple file exports, this should mostly alleviate this issue.
E.g.
// If want to reuse fixtures, we can have a separate endpoint for this. Likewise for other areas for this controller.
import {} from '@metamask/profile-sync-controller/fixtures'
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
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.
LGTM!
Explanation
this is a temp fix so that mobile does not compute these fixtures are runtime. we do need to support multiple exports to ensure that these are not called.
References
https://consensyssoftware.atlassian.net/browse/NOTIFY-958
Changelog
@metamask/profile-sync-controller
Checklist