feat: Data transfer support - #825
Open
LouisCAD wants to merge 44 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds account data-transfer recovery by detecting device changes and re-deriving restored authentication tokens.
Changes:
- Persists Android ID bindings for user tokens via Room.
- Adds restoration orchestration, request blocking, retry/give-up UI, and error handling.
- Moves token derivation into Auth and updates account APIs.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
CrossAppLogin/README.md |
Updates account-removal guidance. |
CrossAppLogin/Back/.../SharedDeviceIdStorage.kt |
Reuses the shared Android ID helper. |
CrossAppLogin/Back/.../BaseCrossAppLoginViewModel.kt |
Uses Auth token derivation APIs. |
Common/.../AndroidId.kt |
Adds the shared Android ID helper. |
Auth/.../UserAccountUtils.kt |
Stores token-device bindings. |
Auth/.../TokenInterceptor.kt |
Waits for restoration handling. |
Auth/.../room/UserDatabase.kt |
Adds the binding entity and migration. |
Auth/.../room/UserDao.kt |
Adds binding queries and user-list APIs. |
Auth/.../PersistedCurrentUserAccountUtils.kt |
Accepts deferred cleanup providers. |
Auth/.../models/TokenDeviceBinding.kt |
Defines token-device persistence. |
Auth/.../DerivedTokenGeneratorImpl.kt |
Moves derivation implementation into Auth. |
Auth/.../DerivedTokenGenerator.kt |
Exposes the derivation contract. |
Auth/.../DerivedTokenGenerator.IssueExtensions.kt |
Centralizes issue policies. |
Auth/.../CredentialManager.kt |
Integrates modern account utilities. |
Auth/.../backup/RestoringFromBackupFailedScreen.kt |
Adds restoration failure UI. |
Auth/.../backup/RestoreFromBackupManagerImpl.kt |
Implements restoration handling. |
Auth/.../backup/RestoreFromBackupManager.kt |
Defines restoration state and API. |
Auth/.../AbstractCurrentUserAccountUtils.kt |
Accepts deferred cleanup providers. |
Auth/schemas/.../9.json |
Records Room schema version 9. |
Auth/build.gradle.kts |
Adds Compose UI dependencies. |
Contributor
Author
|
TODO: Ensure we can disable this for the Authenticator app. |
Contributor
tevincent
requested changes
Aug 3, 2026
LouisCAD
force-pushed
the
data-transfer-support
branch
2 times, most recently
from
August 11, 2026 10:47
87eb958 to
bee0f91
Compare
LouisCAD
force-pushed
the
data-transfer-support
branch
2 times, most recently
from
August 17, 2026 09:41
66a859f to
de52876
Compare
tevincent
requested changes
Aug 17, 2026
LouisCAD
force-pushed
the
data-transfer-support
branch
from
August 17, 2026 16:39
aef2078 to
baef596
Compare
tevincent
approved these changes
Aug 18, 2026
LouisCAD
force-pushed
the
data-transfer-support
branch
2 times, most recently
from
August 19, 2026 12:43
7cdab93 to
c22047b
Compare
Contributor
Author
|
Should be merged once all apps have a ready pending PR with the proper backup rules.
|
This commit also renames LiveData returning getAll() to allAsLiveData()
This could cause notification and device/app registration to not be done again after the user got logged out and re-logged in.
We are not going to allow reusing them. However, we will probably consider using the "standard" API (over the "classic" one), to allow generating many tokens for cheaper thanks to the shared costly operation.
This makes restoreAccounts more digest.
Make RestoreFromBackupManagerImpl accept injectable userDatabase and tokenGenerator constructor parameters (defaulting to the existing production singletons) so the class can be exercised in isolation. Add RestoreFromBackupManagerImplTest covering the full state-machine: - No users → Settled immediately - Same-device users → Settled immediately (no derivation) - Pre-v9 users with missing binding → binding added, Settled - Multiple users, all missing bindings → bindings added, Settled - Transferred device with successful derivation → token & binding updated - Multiple transferred users, all succeed - Mixed (same-device + transferred) - Derivation failure → RestoringFromBackupFailed state emitted - Failure then retry (generator swapped to success) → Settled - Failure then give-up → failed user removed, Settled - Partial failure (one same-device, one transferred-and-failed) → only failed user removed
LouisCAD
force-pushed
the
data-transfer-support
branch
from
August 20, 2026 08:41
c8c224c to
ffb65bd
Compare
|
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
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.



No description provided.