Open
Conversation
6ee45c1 to
bd65ea2
Compare
bd65ea2 to
c6b0d1b
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.

Task/Issue URL: https://app.asana.com/1/137249556945/project/488551667048375/task/1211766481496469?focus=true
Description
Implements the
persistent-storagemodule to be a reusable, key-based abstraction over Google Play Block Store.Changes since the previous placeholder approach in a lower branch
PersistentStorageKeybase class — modules define their own keys with akeystring andshouldBackupToCloudflagstore/retrieve/clearwithByteArrayvalues andResultreturn typesAvailable(isEndToEndEncryptionSupported)andUnavailable(removedBuildTypeUnsupportedand split encrypted/unencrypted variants)Implementation changes:
BlockStoreWrapperto isolate Block Store API calls behind a testable interfaceDummyPersistentStorage(F-Droid) returnsUnavailable/Result.failurewith logcat for debuggingObserver changes:
SyncAutoRecoveryCapabilityObservernow early-returns on F-Droid builds viaAppBuildConfig.flavorcheck (instead of relying onBuildTypeUnsupportedavailability)Steps to test this PR
Internal/Play build on emulator with Play Services
./gradlew installInternalDebugmessage~:"Block Store|Sync-Recovery"Sync-Recovery: capability detection enabled (write=true, read=true)Block Store: available, E2E encryption supported = trueSync-Recovery: persistent storage available with E2E encryptionSync-Recovery: attempting to read from persistent storage...Sync-Recovery: read successSync-Recovery: attempting to write to persistent storage...Block Store: stored com.duckduckgo.sync.derisk.test (N bytes)Sync-Recovery: write successSecond launch (verifies cross-session persistence)
5. Force-stop and relaunch the app
6. Verify read returns previous session's value:
read success (value=N chars)Internal/Play build on device without Play Services (e.g., AOSP emulator)
7. Install:
./gradlew installInternalDebugon an emulator without GMS8. Launch app, wait ~15s for privacy config download
9. Filter logcat:
message~:"Block Store|Sync-Recovery"10. Verify logs show:
-
Sync-Recovery: capability detection enabled (write=true, read=true)-
Block Store: Play Services not available-
Sync-Recovery: persistent storage unavailable11. Verify no read/write attempts — observer exits after unavailable pixel
F-Droid build (validates no-crash on builds without Play Services)
12. Apply patch to enable fdroidDebug variant (comment out variantFilter in
app/build.gradle)13. Install:
./gradlew installFdroidDebug14. Launch app — verify no crash
15. Filter logcat:
message~:"Block Store|Sync-Recovery"— verify no logs (observer early-returns before touching Block Store)16. Re-enable variant filter after testing