diff --git a/packages/syncing-server/src/Domain/UseCase/Syncing/SaveItems/SaveItems.spec.ts b/packages/syncing-server/src/Domain/UseCase/Syncing/SaveItems/SaveItems.spec.ts index 973ca213c..5b3184388 100644 --- a/packages/syncing-server/src/Domain/UseCase/Syncing/SaveItems/SaveItems.spec.ts +++ b/packages/syncing-server/src/Domain/UseCase/Syncing/SaveItems/SaveItems.spec.ts @@ -81,6 +81,7 @@ describe('SaveItems', () => { updateExistingItem.execute = jest.fn().mockResolvedValue(Result.ok(savedItem)) logger = {} as jest.Mocked + logger.debug = jest.fn() logger.error = jest.fn() itemHash1 = ItemHash.create({ diff --git a/packages/syncing-server/src/Domain/UseCase/Syncing/SaveItems/SaveItems.ts b/packages/syncing-server/src/Domain/UseCase/Syncing/SaveItems/SaveItems.ts index 96b66e3bb..f23f30e82 100644 --- a/packages/syncing-server/src/Domain/UseCase/Syncing/SaveItems/SaveItems.ts +++ b/packages/syncing-server/src/Domain/UseCase/Syncing/SaveItems/SaveItems.ts @@ -160,8 +160,11 @@ export class SaveItems implements UseCaseInterface { const tenPercentSpreadArray = Array.from(Array(10).keys()) const diceRoll = this.deterministicSelector.select(dto.userUuid, tenPercentSpreadArray) if (diceRoll !== 1) { + this.logger.debug(`[${dto.userUuid}] Not sending items changed event to client.`) + return } + this.logger.debug(`[${dto.userUuid}] Sending items changed event to client.`) const itemsChangedEvent = this.domainEventFactory.createItemsChangedOnServerEvent({ userUuid: dto.userUuid,