Skip to content

feat: Data transfer support - #3058

Open
LouisCAD wants to merge 5 commits into
mainfrom
data-transfer-support
Open

feat: Data transfer support#3058
LouisCAD wants to merge 5 commits into
mainfrom
data-transfer-support

Conversation

@LouisCAD

@LouisCAD LouisCAD commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Will allow the app to be restored seamlessly from a device backup, or on device migration.

Copilot AI balanced review requested due to automatic review settings September 1, 2026 13:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables cloud backup and device-to-device migration while aligning account access with updated Core APIs.

Changes:

  • Configures Android backup and extraction rules.
  • Adds custom Realm-file backup and restoration.
  • Migrates account consumers to suspend-based APIs.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
app/src/main/AndroidManifest.xml Enables and configures full backup.
app/src/main/res/xml/data_extraction_rules.xml Defines modern backup and transfer data.
app/src/main/res/xml/backup_rules.xml Defines legacy full-backup data.
app/src/main/java/com/infomaniak/mail/backup/MailFullBackupAgent.kt Handles Realm backup and restoration.
app/src/main/java/com/infomaniak/mail/utils/AccountUtils.kt Integrates updated credential management.
app/src/main/java/com/infomaniak/mail/TokenInterceptorListenerProvider.kt Adapts token listener construction.
app/src/main/java/com/infomaniak/mail/workers/SyncMailboxesWorker.kt Uses suspend account retrieval.
app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageViewModel.kt Updates multi-mailbox lookup.
app/src/main/java/com/infomaniak/mail/ui/newMessage/selectMailbox/SelectMailboxViewModel.kt Updates account loading.
app/src/main/java/com/infomaniak/mail/ui/main/user/SwitchUserViewModel.kt Updates account switching data retrieval.
Suppressed comments (2)

app/src/main/res/xml/data_extraction_rules.xml:22

  • This exact-file include omits SQLite's user_database-wal sidecar. A committed account or refreshed API token may still reside only in that WAL, so cloud restore can produce a stale database and fail the promised seamless login. Back up a coordinated SQLite snapshot—either checkpoint/close the Room database before backup or include the required sidecars consistently.
        <include domain="database" path="user_database" />

app/src/main/res/xml/backup_rules.xml:21

  • The legacy full-backup rules also upload user_database, which contains User.apiToken, without requiring client-side encryption. This applies to supported Android 8.1 devices where encrypted cloud backup is not guaranteed. Gate this include with clientSideEncryption (or restrict it to device-to-device transfer) rather than exporting authentication credentials unconditionally.
    <include domain="database" path="user_database" />

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

<!-- path="datastore/" />-->
<include domain="sharedpref" path="." />
<include domain="file" path="datastore/" />
<include domain="database" path="user_database" />
Comment thread app/src/main/java/com/infomaniak/mail/backup/MailFullBackupAgent.kt
<full-backup-content>
<include domain="sharedpref" path="." />
<include domain="file" path="datastore/" />
<include domain="database" path="user_database" />

@LouisCAD LouisCAD Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Do you have a source to this issue that you claim affects API 27 to 30?

@sonarqubecloud

sonarqubecloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

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