microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

Delta query + odata.maxpagesize on calendarView/delta returns more items than requested when a recurring master expands; odata.nextLink results in infinite pagination loop

Open
#3,070 19 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Service issue
Dominant language
C#
Stars
789
Forks
264
Avg merge
15h 17m
Merged PRs (30d)
3

Description

Describe the bug

We are encountering 2 issues when retrieving Events with GetAsDeltaGetResponseAsync and using a maxpagesize header.

  1. When a recurring master event has a recurrence pattern that expands into more individual occurrences than the configured odata.maxpagesize, the server returns more items than the requested page size.

  2. The @odata.nextLink returned points to a next page that, when fetched, contains duplicates of events already received. That next page in turn contains a nextLink which returns the same events again, producing an endless loop.

If maxpagesize is larger than the returned events for a master event including the individual occurrences, then there is no issue

Expected behavior

• The returned events should be less or equal to odata.maxpagesize
• @odata.nextLink must point to a subsequent page that contains only new, non-duplicated items. Pagination tokens should not cause previously-returned items to reappear.

How to reproduce
  1. Create or identify a recurring master event whose recurrence rule expands to more than the intended page size within your query time window (for example a yearly/daily rule with many occurrences).
  2. Request /users/{id}/calendarView/delta with StartDateTime, EndDateTime and header Prefer: odata.maxpagesize={N}.
  3. Inspect the first response:
  • Count of returned items can be > N.
  • A @odata.nextLink is present.
  1. GET the @odata.nextLink:
  • Response contains items that were already included in the previous page (duplicates).
  • A new @odata.nextLink is present and steps 3–4 repeat → infinite loop.
SDK Version

5.103.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing GetAsDeltaGetResponseAsync for the calendarView/delta request and its handling of Prefer: odata.maxpagesize. Reproduce with a recurring event whose occurrences exceed the requested page size, then verify that each response stays within the limit and that @odata.nextLink pages contain no duplicates or infinite loop.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.