From 8e09ca261be1c6da4064b0c31354dea475315646 Mon Sep 17 00:00:00 2001 From: himeshr Date: Fri, 9 Feb 2024 19:05:52 +0530 Subject: [PATCH] #1295 | Exclude clean-up of embedded objects during resetSync clearData --- packages/openchs-android/src/service/ResetSyncService.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/openchs-android/src/service/ResetSyncService.js b/packages/openchs-android/src/service/ResetSyncService.js index 06702abf2..7e73919bb 100644 --- a/packages/openchs-android/src/service/ResetSyncService.js +++ b/packages/openchs-android/src/service/ResetSyncService.js @@ -46,7 +46,11 @@ class ResetSyncService extends BaseService { const isAllDataDeleteRequired = _.some(notMigratedSyncReset, resetSnc => _.isNil(resetSnc.subjectTypeUUID)); if (isAllDataDeleteRequired) { General.logDebug('ResetSyncService', `Deleting all data and resetting the sync`); - const allEntities = _.filter(EntityMappingConfig.getInstance().getEntities(), entity => !_.includes([Settings.schema.name, UserInfo.schema.name, ResetSync.schema.name], entity.schema.name)); + const allEntities = _.filter(EntityMappingConfig.getInstance().getEntities(), + entity => { + return !(entity.schema.embedded || + _.includes([Settings.schema.name, UserInfo.schema.name, ResetSync.schema.name], entity.schema.name)); + }); this.clearDataIn(allEntities); this.entitySyncStatusService.setup(); _.forEach(notMigratedSyncReset, resetSync => this._updateHasMigrated(resetSync));