Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop resetting entities with instances #6473

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,8 @@ public ProjectDeleter providesProjectDeleter(ProjectsRepository projectsReposito
}

@Provides
public ProjectResetter providesProjectResetter(StoragePathProvider storagePathProvider, PropertyManager propertyManager, SettingsProvider settingsProvider, FormsRepositoryProvider formsRepositoryProvider, SavepointsRepositoryProvider savepointsRepositoryProvider, InstancesDataService instancesDataService, ProjectsDataService projectsDataService, EntitiesRepositoryProvider entitiesRepositoryProvider) {
return new ProjectResetter(storagePathProvider, propertyManager, settingsProvider, formsRepositoryProvider, savepointsRepositoryProvider, instancesDataService, projectsDataService.getCurrentProject().getUuid(), entitiesRepositoryProvider);
public ProjectResetter providesProjectResetter(StoragePathProvider storagePathProvider, PropertyManager propertyManager, SettingsProvider settingsProvider, FormsRepositoryProvider formsRepositoryProvider, SavepointsRepositoryProvider savepointsRepositoryProvider, InstancesDataService instancesDataService, ProjectsDataService projectsDataService) {
return new ProjectResetter(storagePathProvider, propertyManager, settingsProvider, formsRepositoryProvider, savepointsRepositoryProvider, instancesDataService, projectsDataService.getCurrentProject().getUuid());
}

@Provides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import org.odk.collect.android.fastexternalitemset.ItemsetDbAdapter
import org.odk.collect.android.instancemanagement.InstancesDataService
import org.odk.collect.android.storage.StoragePaths
import org.odk.collect.android.utilities.WebCredentialsUtils
import org.odk.collect.entities.storage.EntitiesRepository
import org.odk.collect.forms.FormsRepository
import org.odk.collect.forms.savepoints.SavepointsRepository
import org.odk.collect.metadata.PropertyManager
Expand All @@ -34,8 +33,7 @@ class ProjectResetter(
private val formsRepositoryProvider: ProjectDependencyFactory<FormsRepository>,
private val savepointsRepositoryProvider: ProjectDependencyFactory<SavepointsRepository>,
private val instancesDataService: InstancesDataService,
private val projectId: String,
private val entitiesRepositoryFactory: ProjectDependencyFactory<EntitiesRepository>
private val projectId: String
) {
private val storagePaths = storagePathProvider.create(projectId)

Expand Down Expand Up @@ -70,8 +68,6 @@ class ProjectResetter(
}

private fun resetInstances() {
entitiesRepositoryFactory.create(projectId).clear()

if (!instancesDataService.reset(projectId) ||
!deleteFolderContent(storagePaths.instancesDir)
) {
Expand Down