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

Problem with WalletRepository and the lifetime of WalletModel objects #11301

Closed
ichthus1604 opened this issue Aug 16, 2023 · 0 comments · Fixed by #11302
Closed

Problem with WalletRepository and the lifetime of WalletModel objects #11301

ichthus1604 opened this issue Aug 16, 2023 · 0 comments · Fixed by #11302
Assignees

Comments

@ichthus1604
Copy link
Contributor

ichthus1604 commented Aug 16, 2023

Troubleshooting #11260 (comment) I've found several related problems:

  • TransformWithInlineUpdate() here doesn't seem to be working as expected. It still recreates instances of WalletModel objects for the same wallets when it shouldn't. This is the root cause of @molnard's issue of not retaining the volatile WalletSettingsModel.IsCoinjoinPaused flag.

  • I've tried to workaround this here, creating a static dictionary that will hold the WalletModel instances, and while it is a horrible workaround, it seems to have fixed the lifetime problems. We still need to figure out why TransformWithInlineUpdate() isn't working as expected.

  • After this change, wallets are no longer reporting the exchange rate:

image

This is due to the fact that WalletModels are created before Wallets are initialized, and therefore Wallet.Synchronizer is null at this point.

I've tried to fix that, unsuccessfully, by making ExchangeRateProvider aware of the Wallet.State, but so far I haven't managed to make it work properly. hand-crafted IObservable<decimal> are not fired by the UI for reasons I still haven't figured out.

Besides that, I'm not sure what other implications there might be to changing the lifetime of WalletModel objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants