Skip to content

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

Merged
CDRussell merged 1 commit intodevelopfrom
feature/craig/autofill-use-async-sqlcipher-loader
Feb 13, 2026
Merged

Use new sqlcipher native library loader for autofill database initialization#7691
CDRussell merged 1 commit intodevelopfrom
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

@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
Copy link
Member Author

CDRussell commented Feb 13, 2026

Merge activity

  • Feb 13, 12:31 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 13, 12:34 PM UTC: Graphite rebased this pull request as part of a merge.
  • Feb 13, 12:47 PM UTC: @CDRussell merged this pull request with Graphite.

@CDRussell CDRussell changed the base branch from feature/craig/sqlcipher-load-async-capability to graphite-base/7691 February 13, 2026 12:32
@CDRussell CDRussell changed the base branch from graphite-base/7691 to develop February 13, 2026 12:32
@CDRussell CDRussell force-pushed the feature/craig/autofill-use-async-sqlcipher-loader branch from 47a3228 to 346a125 Compare February 13, 2026 12:33
@CDRussell CDRussell merged commit 3efe04c into develop Feb 13, 2026
7 checks passed
@CDRussell CDRussell deleted the feature/craig/autofill-use-async-sqlcipher-loader branch February 13, 2026 12:47
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