Skip to content

Fix for issue 1517 and correction of two tests not respecting the REST reference (impacted by the fix) - #1518

Merged
Vincent Biret (baywet) merged 7 commits into
microsoftgraph:devfrom
kekolab:dev
Feb 21, 2024
Merged

Fix for issue 1517 and correction of two tests not respecting the REST reference (impacted by the fix)#1518
Vincent Biret (baywet) merged 7 commits into
microsoftgraph:devfrom
kekolab:dev

Conversation

@kekolab

Copy link
Copy Markdown
Contributor

Changes proposed in this pull request

The test UploadResponseHandlerTest#getUploadSessionOnProgressingUpload mimicked a server response with a 200/OK response code.
In the REST reference (https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-1.0#upload-bytes-to-the-upload-session) it is stated that the response code for uploading more bytes to the upload session is 202/Accepted.
The bug in #1517 is fixed.
Previously the method UploadResponseHandler#handleResponse handled differently the response in these two cases:

  • response code 200/OK
  • all other cases

Now the same method handles differently the response in these two cases:

  • response code 200/OK or 201/Created
  • all other cases

Everything works if the REST reference is corrected and:

  • 200/OK is returned when an item is updated, 201/Created is returned when an item is Created
  • 202/Accepted is returned when more bytes are requested

The test UploadResponseHandlerTest#getUploadSessionOnProgressingUpload mimicked a server response with a 200/OK response code.
In the REST reference (https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-1.0#upload-bytes-to-the-upload-session) it is stated that the response code for uploading more bytes to the upload session is 202/Accepted.
The bug in #1517 is fixed.
Previously the method UploadResponseHandler#handleResponse handled differently the response in these two cases:
- response code 200/OK
- all other cases

Now the same method handles differently the response in these two cases:
- response code 200/OK or 201/Created
- all other cases

Everything works if the REST reference is corrected and:
- 200/OK is returned when an item is updated, 201/Created is returned when an item is Created
- 202/Accepted is returned when more bytes are requested
@kekolab
Gianluca Coviello (kekolab) requested a review from a team as a code owner February 21, 2024 15:59
@kekolab

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@baywet Vincent Biret (baywet) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the pull request.
Can you please:

  • bump the patch version in gradle.properties
  • update the kiota dependencies version to 1.0.3 in gradle/dependencies.gradle
  • add a changelog entry (today's date, changed section)
  • update the versions in the readme.md

This will help ensure we can quickly publish the changes

@baywet

Copy link
Copy Markdown
Member

Andrew Omondi (@andrueastman) can you also have a look at this change please when compared with dotnet?

- Updated the patch version in gradle.properies
- Updated changelog.md and readme.md with the new patch version
- Bumped kiota dependencies to 1.0.3
- Fixed the test UploadSliceRequestTest.putReturnsExpectedUploadSession which did not respect the response descripted in the REST reference
@kekolab

Copy link
Copy Markdown
Contributor Author

Vincent Biret (@baywet) all done. I also fixed another test case which did not mock what is written in the REST Reference

@kekolab Gianluca Coviello (kekolab) changed the title Fix for issue 1517 and correction of a test not respecting the REST reference (impacted by the fix) Fix for issue 1517 and correction of two test not respecting the REST reference (impacted by the fix) Feb 21, 2024
@kekolab Gianluca Coviello (kekolab) changed the title Fix for issue 1517 and correction of two test not respecting the REST reference (impacted by the fix) Fix for issue 1517 and correction of two tests not respecting the REST reference (impacted by the fix) Feb 21, 2024

@baywet Vincent Biret (baywet) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I just reverted some of the changes to address the root cause.
This is because the implementation was starting to drift when compared with the dotnet one

@baywet
Vincent Biret (baywet) merged commit 93ea88a into microsoftgraph:dev Feb 21, 2024
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.

Updating a file via LargeFileUploadTask does not work (NullPointerException)

2 participants