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

Write notification account information to the correct account #3697

Merged
merged 1 commit into from
Jun 1, 2023
Merged

Write notification account information to the correct account #3697

merged 1 commit into from
Jun 1, 2023

Conversation

nikclayton
Copy link
Contributor

Don't use accountManager.activeAccount throughout the code.

Instead, get the active account once, and use that over the life of the viewmodel.

As shown in #3689 (comment) the active account can change before the view model is destroyed, and if that happens account information for the account will be written to the wrong account.

Don't use `accountManager.activeAccount` throughout the code.

Instead, get the active account once, and use that over the life of the viewmodel.

As shown in #3689 (comment) the active account can change before the view model is destroyed, and if that happens account information for the account will be written to the wrong account.
@nikclayton nikclayton requested a review from connyduck May 29, 2023 20:21
@nikclayton
Copy link
Contributor Author

Logging (and inspecting the database) shows that this is now writing the data to the correct account.

For notifications only -- this doesn't fix the broader data corruption issue, which would be a much more involved PR, and not one I want to tackle during the beta period.

There's one comment in BaseActivity.java.openAsAccount() that I'd like feedback on. If that's a real problem then I'll create an issue for that as well so it doesn't get lost.

@nikclayton nikclayton requested a review from connyduck June 1, 2023 14:06
@nikclayton nikclayton merged commit 346dabf into tuskyapp:develop Jun 1, 2023
@nikclayton nikclayton deleted the 3696-notif-active-account branch June 5, 2023 09:57
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 this pull request may close these issues.

2 participants