Use !== false for safer disabled user filtering

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) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2026-05-28 15:53:25 +02:00
parent 5b07b4ef04
commit 72152935ef
2 changed files with 2 additions and 2 deletions
@@ -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 () => {
@@ -63,7 +63,7 @@ async function* filterDisabledUsers(
users: AsyncIterable<MicrosoftGraph.User>,
): AsyncIterable<MicrosoftGraph.User> {
for await (const user of users) {
if (user.accountEnabled === true) {
if (user.accountEnabled !== false) {
yield user;
}
}