Skip to content

Commit

Permalink
#1295 | Exclude clean-up of embedded objects during resetSync clearData
Browse files Browse the repository at this point in the history
  • Loading branch information
himeshr committed Feb 9, 2024
1 parent 2e48e22 commit 8e09ca2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/openchs-android/src/service/ResetSyncService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 8e09ca2

Please sign in to comment.