Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 7 commits into from
Feb 21, 2024

Conversation

kekolab
Copy link
Contributor

@kekolab kekolab commented Feb 21, 2024

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 kekolab requested a review from a team as a code owner February 21, 2024 15:59
@kekolab
Copy link
Contributor Author

kekolab commented Feb 21, 2024

@microsoft-github-policy-service agree

Copy link
Member

@baywet baywet left a comment

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
Member

baywet commented Feb 21, 2024

@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
Contributor Author

kekolab commented Feb 21, 2024

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

@kekolab 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 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
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Copy link
Member

@baywet baywet left a comment

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 baywet merged commit 93ea88a into microsoftgraph:dev Feb 21, 2024
10 checks passed
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