-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat(2.0, nodejs): Silently request to stop background syncing when WalletMethodHandler
is dropped
#1793
feat(2.0, nodejs): Silently request to stop background syncing when WalletMethodHandler
is dropped
#1793
Conversation
WalletMethodHandler
is droppedWalletMethodHandler
is dropped
WalletMethodHandler
is droppedWallet
is dropped
Wallet
is droppedWalletMethodHandler
is dropped
A potential case where a new Wallet instance is created quickly enough to throw a |
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.
Please rebase to remove the python errors and apply format 🙏🏻
df628ed
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.
Thank you 🙏🏻
Description of change
This will make sure that the background syncing is stopped when the
WalletMethodHandler
is dropped. You might ask why this is useful as there is alreadydestroyWallet
method. Well, this is more like a "fallback" plan for when that method is not called yet the wallet is dropped. For example, I encountered that everytime I edited some frontend code in Firefly, that triggered webpack to reload the frontend, and thus removing from memory all the Wallets instances, without theirstopBackgroundSync
method called. This caused that if I wanted to log into a profile whosestopBackgroundSync
method was not called before, now gave me a rocksdb error, because, the old wallet instance was still living in the background syncing thread, and thus the DB still locked.Type of change
How the change has been tested
In firefly, but you can test it by starting the background syncing and never stopping, but destroying the wallet.
Change checklist
Tick the boxes that are relevant to your changes, and delete any items that are not.