diff --git a/src/services/sync.service.ts b/src/services/sync.service.ts index 9896d82b..c7c55d48 100644 --- a/src/services/sync.service.ts +++ b/src/services/sync.service.ts @@ -164,8 +164,13 @@ export class SyncService { } } else { if (!u.deleted) { - processedActiveUsers.set(u.email, JSON.stringify(u)); - uniqueUsers.push(u); + // Check that active UserEntry does not conflict with a deleted UserEntry + if (processedDeletedUsers.has(u.email)) { + duplicateEmails.push(u.email); + } else { + processedActiveUsers.set(u.email, JSON.stringify(u)); + uniqueUsers.push(u); + } } else { // UserEntrys with duplicate email will not throw an error if they are all deleted. They will be synced. processedDeletedUsers.set(u.email, JSON.stringify(u));