Skip to content

Conversation

@OlivierCuyp
Copy link
Contributor

@OlivierCuyp OlivierCuyp commented Sep 14, 2022

A similar PR may already be submitted! Please search among the Pull request before creating one.

Thanks for submitting a pull request! Please provide enough information so that others can review your pull request.

NOTE: PR's will be accepted only in case of appropriate information is provided below

Summary

PageIterator is mutating the pageCollection he receive in his constructor when it iterates.
The pageCollection.value array will be empty after the call of the iterate method.
The iterate method should not mutate pageCollection.value.

(cfr: #959)

Motivation

Mutation of given parameter is always a bad things and lead application to unexpected behaviour.

Test plan

Demonstrate the code is solid. Example: The exact commands you ran and their output.

I haded an unit test is the PR.

Closing issues

Fixes #959

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@OlivierCuyp OlivierCuyp force-pushed the oliviercuyp/fix-page-iterator-mutation branch from d6946b5 to 7b674a3 Compare September 14, 2022 17:25
@nikithauc nikithauc merged commit 6d104cf into microsoftgraph:dev Sep 14, 2022
@OlivierCuyp OlivierCuyp deleted the oliviercuyp/fix-page-iterator-mutation branch September 14, 2022 21:20
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.

PageIterator should not mutate his arguments

2 participants