Skip to content

Stage and validate backups before restoring#1343

Open
ranchoiver wants to merge 2 commits intooliexdev:masterfrom
ranchoiver:stage-restore-before-swap
Open

Stage and validate backups before restoring#1343
ranchoiver wants to merge 2 commits intooliexdev:masterfrom
ranchoiver:stage-restore-before-swap

Conversation

@ranchoiver
Copy link
Copy Markdown
Contributor

This stages and validates the selected backup before replacing the live database.

  • stage restore input in a temporary directory
  • accept only expected database files from zip restores
  • reject SQLite files that are not openScale databases
  • swap the live database only after validation succeeds
  • add instrumentation coverage for malformed zip input, unrelated SQLite input, and a successful restore round trip

Testing:

  • .\gradlew.bat :app:testDebugUnitTest
  • .\gradlew.bat :app:compileDebugAndroidTestKotlin
  • .\gradlew.bat -Pandroid.testInstrumentationRunnerArguments.class=com.health.openscale.core.usecase.BackupRestoreUseCasesTest :app:connectedDebugAndroidTest

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.

1 participant