Skip to content

Add ConsistencyLevel header to count guest users sample#1245

Merged
jasonjoh merged 2 commits intodevfrom
copilot/fix-174
Sep 2, 2025
Merged

Add ConsistencyLevel header to count guest users sample#1245
jasonjoh merged 2 commits intodevfrom
copilot/fix-174

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 29, 2025

The "count the guest users in your organization" sample was missing the required ConsistencyLevel header needed for advanced query capabilities when using $count operations on Directory Objects.

This change adds the missing header to ensure consistency with other similar samples:

"headers": [
  {
    "name": "ConsistencyLevel",
    "value": "eventual"
  }
]

The sample now follows the same pattern as other $count operations like "count the users in your tenant excluding guests (raw count)" which already had this header. Both samples use /v1.0/users/$count with filters on user types and require the ConsistencyLevel header according to Microsoft Graph documentation for advanced query capabilities.

Fixes #174.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • docs.microsoft.com
    • Triggering command: node scripts/test-initiator.js --no-watch (dns block)
    • Triggering command: node scripts/test-initiator.js --no-watch --testNamePattern=count the guest users in your organization (dns block)
  • learn.microsoft.com
    • Triggering command: node scripts/test-initiator.js --no-watch (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: jasonjoh <8966342+jasonjoh@users.noreply.github.com>
Copilot AI changed the title [WIP] Add consistency level headers to relevant samples Add ConsistencyLevel header to count guest users sample Aug 29, 2025
Copilot AI requested a review from jasonjoh August 29, 2025 16:37
@jasonjoh jasonjoh marked this pull request as ready for review August 29, 2025 16:49
Copilot AI review requested due to automatic review settings August 29, 2025 16:49
@jasonjoh jasonjoh requested a review from a team as a code owner August 29, 2025 16:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds the required ConsistencyLevel header to the "count the guest users in your organization" sample query to enable advanced query capabilities for $count operations on Directory Objects.

  • Adds missing ConsistencyLevel: eventual header to ensure compliance with Microsoft Graph requirements
  • Aligns the sample with other similar $count operations that already include this header
  • Fixes a functional issue where the query would not work properly without the required header

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jasonjoh jasonjoh merged commit d21aa12 into dev Sep 2, 2025
6 checks passed
@jasonjoh jasonjoh deleted the copilot/fix-174 branch September 2, 2025 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add consistency level headers to relevant samples

4 participants