Skip to content

[SQLCipher] Database Corruption/Recovery Failure after "Remember Me" and User Switch, Even After Reinstall #433

Description

@abhinavRepo26
Image

[SQLCipher] Database Corruption After User Switch with "Remember Me" - Persists After Reinstall

Description
When a user enables the "Remember Me" checkbox during login and then attempts to log in as a different user, the application's transactional sync fails with a SQLiteNotADatabaseException. This error persists even after completely uninstalling and reinstalling the application, indicating the problem is related to persistent, encrypted storage that survives an app uninstall.

Error
net.zetetic.database.sqlcipher.SQLiteNotADatabaseException: file is not a database (code 26)", while compiling: SELECT COUNT(*) FROM sqlite_schema

Steps to Reproduce

  1. On a clean install, log in as User A with the "Remember Me" checkbox checked
  2. Log out of the application
  3. Attempt to log in as User B (with or without "Remember Me")
  4. Observe the transactional sync failure error
  5. Uninstall the application
  6. Reinstall the application
  7. Attempt to log in again (as any user) - the sync error persists

Expected Behavior

  • Switching users should not corrupt the underlying database
  • If corruption occurs, the app should have a recovery mechanism (e.g., deleting corrupted database and creating new one)
  • Uninstalling the application should completely remove all user data, allowing fresh start upon reinstall

Environment

  • SDK Version: 13.1.0
  • React Native: TypeScript template
  • Platforms: iOS & Android

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions