mirror of
https://github.com/KelvinTegelaar/CIPP.git
synced 2026-04-25 16:26:09 +03:00
[GH-ISSUE #4517] [Bug]: App Registrations List Dropping Last Item #2075
Labels
No labels
API
Feature
NotABug
NotABug
Planned
Sponsor Priority
Sponsor Priority
bug
documentation
duplicate
enhancement
needs more info
no-activity
no-priority
not-assigned
pull-request
react-conversion
react-conversion
roadmap
security
stale
unconfirmed-by-user
unconfirmed-by-user
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/CIPP#2075
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Ben-ITLogic on GitHub (Aug 12, 2025).
Original GitHub issue: https://github.com/KelvinTegelaar/CIPP/issues/4517
Required confirmations before submitting
Issue Description
Endpoint: applications
Top: 999
Use $count: On
The graph explorer configuration matches the API calls made from the CIPP page data (to the best of my ability)
Environment Type
Non-sponsored user
Front End Version
v8.3.0
Back End Version
v8.3.0
Relevant Logs / Stack Trace
@github-actions[bot] commented on GitHub (Aug 12, 2025):
Thank you for reporting a potential bug. If you would like to work on this bug, please comment:
Thank you for helping us maintain the project!
@Ben-ITLogic commented on GitHub (Aug 12, 2025):
Okay, I did a bit more digging.
The page calls:
/api/ListGraphRequest?tenantFilter=DOMAIN&Endpoint=applications&$count=true&$top=999
The Graph Explorer calls:
/api/ListGraphRequest?tenantFilter=DOMAIN&endpoint=applications&$filter=&$expand=&$top=&$search=&$format=&ReverseTenantLookupProperty=tenantId&manualPagination=false&IsShared=false&name=&AsApp=false
The issue seems to be manualPagination=.
If manualPagination=false OR manualPagination=true, the results return correctly.
@nichxlxs commented on GitHub (Aug 12, 2025):
Invoke-ListGraphRequest unconditionally drops the last record to attempt to remove the
nextLinkelement.There are two possibilities this can drop a real row:
If the
nextLinkproperty is not at the end (e.g., it's in the middle of the array after being merged inGet-GraphRequestList).In a small dataset, there is no real
nextLink, however,$Results.nextLinkreturns an array of values (often@($null,$null,...)when no element has a 'nextLink' property set). In PowerShell, a non-empty array of$nullis evaluated as truthy in anif, even if every element is$null. The block will run even when there is no actualnextLink, causing the real item to be dropped anyway.This only happens when the
NoPagination/manualPaginationparameters are not provided, because:Get-GraphRequestList, if.NoPagination.IsPresentis$true(eithertrueorfalse), the$countbranch is skipped, andNew-GraphGetRequestis called in a mode that either:nextLinkproperty at all as single page), or{ nextLink = … }object always as the last element – in this case dropping the last element is safe.When
.NoPaginationis omitted, the$countbranch runs, which can merge in a{ nextLink = … }object in a non-last position or can also trigger the truthy condition above if there is a small data size.Another thing to note is that this is the default behaviour in the “App Registrations” page, which automatically appends
&$count=true&$top=999to the query and does not setmanualPagination. That means small result sets lose one record.