Skip to content

SDKS-4716: Add disaster recovery cleanup handling#166

Open
vibhorgoswami wants to merge 1 commit intodevelopfrom
SDKS-4716
Open

SDKS-4716: Add disaster recovery cleanup handling#166
vibhorgoswami wants to merge 1 commit intodevelopfrom
SDKS-4716

Conversation

@vibhorgoswami
Copy link
Contributor

@vibhorgoswami vibhorgoswami commented Feb 26, 2026

JIRA Ticket

SDKS-4716

Description

Add disaster recovery when opening the database when migrating Legacy auth data. This prevents the migration to fail when in disaster recovery.

Problem Scenario

When an app is uninstalled, database files may remain on the device. When the app is reinstalled with the same package name, the Android KeyStore generates a new encryption passphrase, making the old database files unreadable. This causes SQLCipher to throw SQLiteNotADatabaseException: file is not a database (code 26).

Solution

This function proactively checks if there is an existing database available and backup data or deletes any existing OATH and Push database files if they are unrecoverable before initializing new storage instances, ensuring a clean migration environment.

Database Files Cleaned

  • pingidentity_oath.db - OATH/TOTP credentials database
  • pingidentity_push.db - Push credentials, notifications, and device tokens database

@vibhorgoswami vibhorgoswami self-assigned this Feb 26, 2026
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 0% with 215 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.83%. Comparing base (cb96135) to head (13f85d2).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...tity/auth/migration/AuthenticatorMigrationSteps.kt 0.00% 166 Missing ⚠️
...ty/auth/migration/LegacyAuthenticatorRepository.kt 0.00% 44 Missing ⚠️
...n/com/pingidentity/auth/migration/AuthMigration.kt 0.00% 5 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #166      +/-   ##
=============================================
- Coverage      45.60%   44.83%   -0.77%     
  Complexity      1228     1228              
=============================================
  Files            302      302              
  Lines           9186     9347     +161     
  Branches        1294     1346      +52     
=============================================
+ Hits            4189     4191       +2     
- Misses          4455     4616     +161     
+ Partials         542      540       -2     
Flag Coverage Δ
integration-tests 26.12% <0.00%> (-0.50%) ⬇️
unit-tests 26.03% <0.00%> (-0.46%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vibhorgoswami vibhorgoswami marked this pull request as ready for review February 26, 2026 19:32
@vibhorgoswami vibhorgoswami marked this pull request as draft February 27, 2026 16:52
@vibhorgoswami vibhorgoswami force-pushed the SDKS-4716 branch 3 times, most recently from c3fbd26 to ecb60f6 Compare February 27, 2026 20:00
@vibhorgoswami vibhorgoswami marked this pull request as ready for review February 27, 2026 22:05
@vibhorgoswami vibhorgoswami force-pushed the SDKS-4716 branch 3 times, most recently from b725735 to 127dc8a Compare March 3, 2026 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant