You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix Graph batch request contracts for public delegation - #1590
Fix request handling in the private Invoke-ZtGraphBatchRequest helper,
addressing the prerequisite issues raised in the review of #1584.
This PR updates the private helper only. Public delegation and parameter
forwarding remain part of #1584. The API-version fix is handled separately in #1591. This PR does not add
private GraphBaseUri support.
Changes
Support OutputType, mapping PSCustomObject to the SDK's PSObject representation.
Correct collection output, matched results, and NoPaging behavior.
Preserve zero and string request IDs and reject case-insensitive duplicates.
Validate response IDs and statuses before emitting results.
Fail incomplete or malformed batches without partial output or resubmission.
Use URL-bearing request descriptors as malformed-response error targets.
Restore outer retries for GET/HEAD-only batches using Invoke-ZtRetry.
Isolate intermediate retry errors from caller error variables after successful recovery.
Avoid replaying batches containing writes after outer failures.
Normalize and validate dependsOn IDs; require dependency-bearing workloads to fit within one batch.
Remove satisfied dependency references from retry descriptors without replaying successful prerequisites.
This enumerates every previously created task's ID for each explicit ID, making request preparation quadratic before transport starts. The public caller assigns explicit IDs to every request (public/Invoke-ZtGraphRequest.ps1:287–293), so 10,000 requests cause roughly 50 million prior IDs to be enumerated, with repeated array allocation. Track seen explicit IDs in a case-insensitive hashtable instead; generated IDs already avoid explicit IDs through ReservedIDs.
Generated numeric IDs collide with explicit string IDs
Generated request IDs remain integers, so these membership checks can compare explicit string IDs numerically. For example, -Request @('users', @{ id = '01'; url = 'groups' }) rejects '01' as a duplicate of generated ID '1', although they are distinct correlation IDs. Dependency validation also accepts '01' as a reference to generated ID '1', leaving a dangling dependency in the submitted batch. Store generated request IDs as strings and add regression tests for both cases.
Generated task IDs remain integers, so this containment check can compare IDs numerically. For example, -Request @('users', @{ id = '01'; url = 'groups' }) rejects '01' as a duplicate of generated ID 1, although the correlation strings '1' and '01' are distinct. Store generated task IDs as strings so duplicate and dependency checks consistently use string equality, and add a regression test for this mixed-ID workload.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix request handling in the private Invoke-ZtGraphBatchRequest helper,
addressing the prerequisite issues raised in the review of #1584.
This PR updates the private helper only. Public delegation and parameter
forwarding remain part of #1584. The API-version fix is handled separately in #1591. This PR does not add
private
GraphBaseUrisupport.Changes
OutputType, mappingPSCustomObjectto the SDK'sPSObjectrepresentation.NoPagingbehavior.Invoke-ZtRetry.dependsOnIDs; require dependency-bearing workloads to fit within one batch.