-
Notifications
You must be signed in to change notification settings - Fork 568
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
Cache snap state in memory #2980
base: main
Are you sure you want to change the base?
Conversation
19202f3
to
1a95f6b
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2980 +/- ##
=======================================
Coverage 94.72% 94.73%
=======================================
Files 497 498 +1
Lines 10826 10859 +33
Branches 1654 1659 +5
=======================================
+ Hits 10255 10287 +32
- Misses 571 572 +1 ☔ View full report in Codecov by Sentry. |
2c7f8fa
to
cd4b9b3
Compare
expect(pbkdf2Sha512).toHaveBeenCalledTimes(1); | ||
|
||
snapController.destroy(); | ||
}); | ||
|
||
it('logs an error message if the state fails to persist', async () => { |
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.
Can we add a test that the persistence is properly mutexed and therefore queued running two parallel update calls or something
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/[email protected] |
To improve performance when using state, especially when using the new state methods (#2916), we now cache state in memory, and write updates to disk asynchronously. The first time the state is fetched, it's cached in the Snap's runtime data, which is used in subsequent calls.