From a7a3ccdb71feea97bea50af318f11822fb0c6216 Mon Sep 17 00:00:00 2001 From: MoxAmber Date: Wed, 17 Jun 2026 15:20:32 +0100 Subject: [PATCH] Merge pull request #34639 from overleaf/as-link-sharing-editinvitecount [web] Ignore reuable invites (aka sharing links) when checking edit invite count GitOrigin-RevId: 355ec6e6b2d5d497392fe1bdc04e68ad80349518 --- .../app/src/Features/Collaborators/CollaboratorsInviteGetter.mjs | 1 + .../unit/src/Collaborators/CollaboratorsInviteGetter.test.mjs | 1 + 2 files changed, 2 insertions(+) diff --git a/services/web/app/src/Features/Collaborators/CollaboratorsInviteGetter.mjs b/services/web/app/src/Features/Collaborators/CollaboratorsInviteGetter.mjs index 9781104840..917bde9b91 100644 --- a/services/web/app/src/Features/Collaborators/CollaboratorsInviteGetter.mjs +++ b/services/web/app/src/Features/Collaborators/CollaboratorsInviteGetter.mjs @@ -23,6 +23,7 @@ async function getEditInviteCount(projectId) { const count = await ProjectInvite.countDocuments({ projectId, privileges: { $ne: PrivilegeLevels.READ_ONLY }, + reusable: { $ne: true }, }).exec() return count } diff --git a/services/web/test/unit/src/Collaborators/CollaboratorsInviteGetter.test.mjs b/services/web/test/unit/src/Collaborators/CollaboratorsInviteGetter.test.mjs index 5f1ba7e2df..f95c8a438e 100644 --- a/services/web/test/unit/src/Collaborators/CollaboratorsInviteGetter.test.mjs +++ b/services/web/test/unit/src/Collaborators/CollaboratorsInviteGetter.test.mjs @@ -88,6 +88,7 @@ describe('CollaboratorsInviteGetter', function () { expect(ctx.ProjectInvite.countDocuments).to.be.calledWith({ projectId: ctx.projectId, privileges: { $ne: 'readOnly' }, + reusable: { $ne: true }, }) expect(count).to.equal(2) })