From 72152935efef32e110c8a97044e28da8fb63f51d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Thu, 28 May 2026 15:53:25 +0200 Subject: [PATCH] Use !== false for safer disabled user filtering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The === true check would silently drop all users if accountEnabled is not in the API response (e.g. if the default projection omits it). The !== false check is safer: it only filters users that are explicitly disabled, and passes through users with unset accountEnabled (same as pre-v1.51.0 behavior). Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Fredrik Adelöw --- .../src/microsoftGraph/read.test.ts | 2 +- .../catalog-backend-module-msgraph/src/microsoftGraph/read.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/read.test.ts b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/read.test.ts index af21e0aa20..1465024560 100644 --- a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/read.test.ts +++ b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/read.test.ts @@ -384,7 +384,7 @@ describe('read microsoft graph', () => { }); const names = users.map(u => u.metadata.name); - expect(names).toEqual(['enabled_example.com']); + expect(names).toEqual(['enabled_example.com', 'unset_example.com']); }); it('should include accountEnabled in select when userSelect is set', async () => { diff --git a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/read.ts b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/read.ts index dba8cd6f64..fc6d78fea3 100644 --- a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/read.ts +++ b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/read.ts @@ -63,7 +63,7 @@ async function* filterDisabledUsers( users: AsyncIterable, ): AsyncIterable { for await (const user of users) { - if (user.accountEnabled === true) { + if (user.accountEnabled !== false) { yield user; } }