diff --git a/apps/meteor/server/models/raw/LivechatInquiry.ts b/apps/meteor/server/models/raw/LivechatInquiry.ts index 3178d217be4f..52aedd0585f8 100644 --- a/apps/meteor/server/models/raw/LivechatInquiry.ts +++ b/apps/meteor/server/models/raw/LivechatInquiry.ts @@ -154,10 +154,7 @@ export class LivechatInquiryRaw extends BaseRaw implemen }, }, { - locked: false, - }, - { - locked: { $exists: false }, + locked: { $ne: true }, }, ], }, @@ -189,7 +186,7 @@ export class LivechatInquiryRaw extends BaseRaw implemen async unlockAll(): Promise { return this.updateMany( - { $or: [{ lockedAt: { $exists: true } }, { locked: { $exists: true } }] }, + { locked: { $exists: true } }, { $unset: { locked: 1, lockedAt: 1 }, $set: { status: LivechatInquiryStatus.QUEUED, queuedAt: new Date() } }, ); }