From 783a5da0c218870bdba89ebe78a35b0f0f14f73b Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Fri, 27 Sep 2024 21:39:39 +0200 Subject: [PATCH] Reset savepoints when resetting instances --- .../java/org/odk/collect/android/projects/ProjectResetter.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/collect_app/src/main/java/org/odk/collect/android/projects/ProjectResetter.kt b/collect_app/src/main/java/org/odk/collect/android/projects/ProjectResetter.kt index 57fcc979c57..acf28e56aec 100644 --- a/collect_app/src/main/java/org/odk/collect/android/projects/ProjectResetter.kt +++ b/collect_app/src/main/java/org/odk/collect/android/projects/ProjectResetter.kt @@ -70,12 +70,13 @@ class ProjectResetter( } private fun resetInstances() { - entitiesRepositoryFactory.create(projectId).clear() - if (!instancesDataService.deleteAll(projectId) || !deleteFolderContent(storagePaths.instancesDir) ) { failedResetActions.add(ResetAction.RESET_INSTANCES) + } else { + entitiesRepositoryFactory.create(projectId).clear() + savepointsRepositoryProvider.create(projectId).deleteAll() } }