-
Notifications
You must be signed in to change notification settings - Fork 842
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
Main+Store: NeDB persistence and integrity + dependency update #3845
Conversation
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.
Add some comments?
Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
@PikachuEXE |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
Leaving this for @absidue |
On MacOS (dev) when I quit the app it looks stuck for a long time (>10s) Edit: to reproduce, import subscriptions/clear subscriptions/playlist/history with large enough number (I did it with playlists on my playlist branch) |
What's your basis on it appearing stuck? Genuinely asking since I don't know the MacOS details. Regardless, that also implies that, if you take those actions without my PR, these two things were probably happening before (depending on how
These are, at best, speculations since I can't test, feel free to verify and let me know. |
It's a tough situation to work around... session.defaultSession.clearCache(),
session.defaultSession.clearStorageData({
storages: [
'appcache',
'cookies',
'filesystem',
'indexdb',
'shadercache',
'websql',
'serviceworkers',
'cachestorage'
] build and check if that still happens? |
Let me see how to reproduce that long exit delay consistently first |
Pull Request Type
Related issue
I'm sure there are issues related to this, but I wouldn't close them until some time has passed in order to check if this passes the test of time (due to the integrity problem being such a rare heisenbug and dependent on timing).
Description
This PR replaces the
nedb-promises
dependency with@seald-io/nedb
(which the former used internally).Given that the internal dependency now supports
Promise
s natively,nedb-promises
is now fundamentally obsolete.Additionally, clean up code in the main process has been freshen up and data store compaction is performed before terminating the main process to ensure that all former operations in the queue have finished executing.
This will hopefully prevent any integrity issues related to the datafiles in the case of standard process terminations.
Testing
Everything seems to be working correctly after the dependency switch and appropriate refactoring.
Desktop
development
(8025945)