-
-
Notifications
You must be signed in to change notification settings - Fork 255
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
Bugfix/4492/fix missing users in UI #4667
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…false Before, getAnyUserAndSetAsActive did only set a random first user to current=true without to check if there is any other current user. So it was up to the calling function of getAnyUserAndSetAsActive to check this. I did not identify a scenario where the getAnyUserAndSetAsActive could cause to set multiple users to current, but anyway the new implementation might fix some scenario that i could not reproduce. Signed-off-by: Marcel Hibbe <[email protected]>
…tActiveUser() is empty To make sure getAnyUserAndSetAsActive() is invoked lazily and avoid any side effects, it's explicitly wrapped it in a lambda. Maybe.defer ensures that getAnyUserAndSetAsActive() is not invoked until switchIfEmpty decides it’s needed. Signed-off-by: Marcel Hibbe <[email protected]>
usersDao.getActiveUser() will return only one current users even if multiple exist for whatever reason. By executing setUserAsActiveWithId(it.id) with the same user, it is made sure all other users current status is set to 0. This change won't fix the root cause if multiple users are set to current, but it will make sure the state is fixed as soon as there is a query to get the active user. In fact, this change might also make it harder to find the root cause because debugging may be more difficult! When searching for the root cause, always keep this in mind and maybe revert the change. Signed-off-by: Marcel Hibbe <[email protected]>
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/4667-talk.apk |
/backport to stable-21.0 |
rapterjet2004
approved these changes
Feb 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolve #4492 (commits 307ebd3 and 22b8b59 might not fix the root cause but commit b69f215 makes sure DB state is healed)
there will be more followup PR's regarding multi user issues...
🏁 Checklist
/backport to stable-xx.x