Skip to content

Use new sqlcipher native library loader for autofill database initialization#7691

Open
CDRussell wants to merge 1 commit intofeature/craig/sqlcipher-load-async-capabilityfrom
feature/craig/autofill-use-async-sqlcipher-loader
Open

Use new sqlcipher native library loader for autofill database initialization#7691
CDRussell wants to merge 1 commit intofeature/craig/sqlcipher-load-async-capabilityfrom
feature/craig/autofill-use-async-sqlcipher-loader

Conversation

@CDRussell
Copy link
Member

@CDRussell CDRussell commented Feb 6, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/task/1213119837878194

Description

Updates autofill database initialization to utilize the new SqlCipherLibraryLoader

  • Logcat filter: message~:"SqlCipher-Init: |Autofill-DB-Init: "
  • Patches for testing the various error cases: Testing patches

Steps to test this PR

Update from previous version path

  • Fresh install from develop
  • Launch the app and save a password or two
  • Install this branch over the top
  • Launch the app and confirm the passwords are still accessible

Fresh install path

  • Fresh install from this branch
  • Confirm in the logs that Database created successfully

Test timeout scenario

  • Apply the timeout patch
  • Launch the app and confirm the app isn't blocked (UI is still responsive etc...)
  • Wait for more than 10s until you see SqlCipher library load failure - cannot create database: kotlinx.coroutines.TimeoutCancellationException
  • Try to access passwords and verify you get the device not supported messaging
  • Kill and restart the app; this time try to access passwords within 10s. Confirm the passwords screen stays blank until it updates to say device not supported.

Test slow loading scenario

  • Remove current patch, and apply the slow loading patch
  • Launch the app and confirm the app isn't blocked (UI is still responsive etc...)
  • Wait for ~8s and verify you see Database created successfully and passwords then works

#### Test failure scenario

  • Remove the current patch, and apply the failure patch
  • Launch the app and verify in logs you see cannot create database:
  • Confirm passwords not being available is gracefully handled

Feature flag disabled

  • Remove the current patch and install the app with no local changes
  • Update autofill/sqlCipherAsyncLoading to disabled
  • Kill and restart the app
  • Verify in logs you see Starting synchronous library load on thread main and Database created successfully

Note

Medium Risk
Changes the initialization path for the encrypted autofill database and introduces new failure/timeout behavior that can return null, which could affect password availability if the loader or timing behaves unexpectedly.

Overview
Updates autofill secure storage DB initialization to depend on the new SqlCipherLibraryLoader instead of loading sqlcipher in the factory init, and gates DB creation on waitForLibraryLoad() (returning null on timeout/failure) with more detailed Autofill-DB-Init logging.

Adds a new RealSecureStorageDatabaseFactoryTest covering successful creation, library load timeout/failure, keystore-inaccessible behavior, instance caching, and concurrent callers only triggering a single initialization.

Written by Cursor Bugbot for commit 9783923. Configure here.

Copy link
Member Author

CDRussell commented Feb 6, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@CDRussell CDRussell marked this pull request as ready for review February 6, 2026 13:24
@CDRussell CDRussell force-pushed the feature/craig/autofill-use-async-sqlcipher-loader branch from 9783923 to 47a3228 Compare February 6, 2026 14:25
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