Skip to content

feat: Add testing Block Store - #870

Open
LouisCAD wants to merge 4 commits into
mainfrom
fake-block-store
Open

LouisCAD wants to merge 4 commits into
mainfrom
fake-block-store

Conversation

@LouisCAD

@LouisCAD LouisCAD commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Because Block Store doesn't restore data
on Google APIs emulators once the app has been
uninstalled or had its data cleared.

This should allow testing in debug without going through the tedious process of:

  1. Preparing the app for a release
  2. Publishing the release
  3. Installing it on the target test device
  4. Setting up the app (horrible passwords to type)
  5. Triggering the backup
  6. Waiting for it to complete (minutes)
  7. Resetting the device
  8. Waiting for it to complete (minutes)
  9. Setting up the device (horrible passwords to type)
  10. Waiting for each step to complete (minutes)
  11. Waiting for the apps to get reinstalled by the Play Store
  12. Hoping you don't have to restart at step 1 because it didn't work and the app is not debuggable

@LouisCAD
LouisCAD requested review from tevincent and a balanced review from Copilot October 1, 2026 13:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The fdroid variant cannot compile, the public API change breaks consumers, and the test store mishandles replacement and deletion state.

Review effort: Balanced
Findings: 2 High severity · 2 Medium severity

Open (4)
What changed in this PR

Adds a file-backed Block Store implementation for testing backup and restore flows in debuggable builds.

Changes:

  • Abstracts Google Play Services Block Store access.
  • Adds debug file-backed storage and backup integration.
  • Passes backup output through the credentials backup API.
File Description
Auth/​src/​standard/​kotlin/​com/​infomaniak/​core/​auth/​backup/​BlockStoreTestingImpl.kt Implements test storage and backup.
Auth/​src/​standard/​kotlin/​com/​infomaniak/​core/​auth/​backup/​BlockStorePlayServicesImpl.kt Wraps the production Block Store client.
Auth/​src/​standard/​kotlin/​com/​infomaniak/​core/​auth/​backup/​BlockStoreBackup.kt Uses the new abstraction.
Auth/​src/​standard/​kotlin/​com/​infomaniak/​core/​auth/​backup/​BlockStore.kt Defines and selects Block Store implementations.
Auth/​src/​main/​kotlin/​com/​infomaniak/​core/​auth/​backup/​BlockStoreCredentialsBackup.kt Integrates test-data backup.
Auth/​build.gradle.kts Adds the Splitties bitflags dependency.

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

Comment thread Auth/src/standard/kotlin/com/infomaniak/core/auth/backup/BlockStoreTestingImpl.kt Outdated
Comment thread Auth/src/standard/kotlin/com/infomaniak/core/auth/backup/BlockStoreTestingImpl.kt Outdated
Because Block Store doesn't restore data
on Google APIs emulators once the app has been
uninstalled or had its data cleared.

This should allow testing in debug without
going through the tedious process of:
1. Preparing the app for a release
2. Publishing the release
3. Installing it on the target test device
4. Setting up the app (horrible passwords to type)
5. Triggering the backup
6. Waiting for it to complete (minutes)
7. Resetting the device
8. Waiting for it to complete (minutes)
9. Setting up the device (horrible passwords to type)
10. Waiting for each step to complete (minutes)
11. Waiting for the apps to get reinstalled by the Play Store
12. Hoping you don't have to restart at step 1 because it didn't work and the app is not debuggable
@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The testing backend can bypass cloud eligibility during default backup and maps arbitrary keys unsafely to filesystem paths.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
Resolved since last review (4)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Correctness depends on Android backup transports and host-app backup rules that cannot be fully verified within this repository.

Review effort: Balanced
Findings: None

Resolved since last review (2)

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