Skip to content

SDKS-4716: Add disaster recovery cleanup handling#166

Merged
vibhorgoswami merged 1 commit intodevelopfrom
SDKS-4716
Mar 4, 2026
Merged

SDKS-4716: Add disaster recovery cleanup handling#166
vibhorgoswami merged 1 commit intodevelopfrom
SDKS-4716

Conversation

@vibhorgoswami
Copy link
Copy Markdown
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
Copy Markdown

codecov bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 0% with 219 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.82%. Comparing base (cb96135) to head (17455c6).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
...tity/auth/migration/AuthenticatorMigrationSteps.kt 0.00% 170 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.82%   -0.78%     
  Complexity      1228     1228              
=============================================
  Files            302      302              
  Lines           9186     9350     +164     
  Branches        1294     1346      +52     
=============================================
+ Hits            4189     4191       +2     
- Misses          4455     4619     +164     
+ Partials         542      540       -2     
Flag Coverage Δ
integration-tests 26.09% <0.00%> (-0.53%) ⬇️
unit-tests 26.04% <0.00%> (-0.45%) ⬇️

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 4 times, most recently from 127dc8a to 13f85d2 Compare March 4, 2026 00:24
Copy link
Copy Markdown
Contributor

@spetrov spetrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍🏻

@vibhorgoswami vibhorgoswami merged commit 74b0a2f into develop Mar 4, 2026
15 of 17 checks passed
@vibhorgoswami vibhorgoswami deleted the SDKS-4716 branch March 4, 2026 20:10
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.

3 participants