-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Factorize user and current user id logic inside of core #679
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
Open
LunarX
wants to merge
46
commits into
main
Choose a base branch
from
update-account-utils
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or 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
b919c26 to
0fc8b51
Compare
993c3e7 to
8794f7a
Compare
tevincent
requested changes
Jan 28, 2026
Auth/src/main/kotlin/com/infomaniak/core/auth/models/CurrentUserId.kt
Outdated
Show resolved
Hide resolved
Auth/src/main/kotlin/com/infomaniak/core/auth/models/CurrentUserId.kt
Outdated
Show resolved
Hide resolved
Auth/src/main/kotlin/com/infomaniak/core/auth/AbstractUserIdAccountUtils.kt
Outdated
Show resolved
Hide resolved
Auth/src/main/kotlin/com/infomaniak/core/auth/AbstractCurrentUserAccountUtils.kt
Show resolved
Hide resolved
Auth/src/main/kotlin/com/infomaniak/core/auth/AccountUtilsCommon.kt
Outdated
Show resolved
Hide resolved
Auth/src/main/kotlin/com/infomaniak/core/auth/PersistedUserIdAccountUtils.kt
Outdated
Show resolved
Hide resolved
Auth/src/test/java/com/infomaniak/core/auth/AccountUtilsCommonTest.kt
Outdated
Show resolved
Hide resolved
Auth/src/test/java/com/infomaniak/core/auth/BaseAccountUtilsTest.kt
Outdated
Show resolved
Hide resolved
Auth/src/test/java/com/infomaniak/core/auth/PersistedUserIdAccountUtilsTest.kt
Outdated
Show resolved
Hide resolved
Auth/src/test/java/com/infomaniak/core/auth/PersistedUserIdAccountUtilsTest.kt
Show resolved
Hide resolved
tevincent
approved these changes
Jan 29, 2026
bee926d to
8db28f4
Compare
…about currentUserFlow
…entUserAccountUtils
8db28f4 to
d0d42b6
Compare
…r when not selected
…ccountUtils level
b080379 to
0b3a2f7
Compare
96c62e3 to
8b81d9e
Compare
This protects against only updating half of the room state by making these transactions atomic
8b81d9e to
b7cb28d
Compare
|
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.


Lots of code was duplicated among all our apps. Here the duplicated code is centralized. Also the currentUser and currentUserId now rely on flow instead of hardcoded values to avoid initilization errors and keep a single source of truth.
The system is designed for apps that only need to handle users and for apps that also need to store a current user. Both use cases are supported.
CredentialManager is split into two classes, the unnecessary code stays inside CredentialManager and only the needed code goes into BaseCredentialManager for the new utils