-
Notifications
You must be signed in to change notification settings - Fork 54
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
Use modern API to cancel requests #1247
Merged
Merged
Conversation
This file contains 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
artonge
commented
May 16, 2022
artonge
commented
May 16, 2022
5cd3f21
to
657f23b
Compare
skjnldsv
approved these changes
May 16, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 🚀
We should do that in more places :)
/rebase |
/compile amend / |
First click: open the viewer Second click: close the viewer But the second click does not correctly close the Viewer, as the method used to cancel the requests does not work. This PR use modern API to cancel the requests. The requests are now correctly aborted, and the `openFile` method exit because the request call throws an exception. Fix #893 https://axios-http.com/docs/cancellation https://developer.mozilla.org/en-US/docs/Web/API/AbortController Signed-off-by: Louis Chemineau <louis@chmn.me> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
657f23b
to
beb81f0
Compare
backports? |
/backport to stable24 |
/backport to stable23 |
/backport to stable22 |
This was referenced May 17, 2022
artonge
added a commit
that referenced
this pull request
Jun 30, 2022
- Webdav support AbortControler since v4.8.0: https://github.com/perry-mitchell/webdav-client/blob/master/CHANGELOG.md#v480= - Axios support AbortControler since v0.22.0: https://github.com/axios/axios/releases/tag/v0.22.0 - @nextcloud/axios is based on > v0.22.0 since v1.8.0: https://github.com/nextcloud/nextcloud-axios/blob/v1.8.0/package.json#L37= Follow up of #1247 Signed-off-by: Louis Chemineau <louis@chmn.me>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
When double-clicking on a file, the behavior is:
First click: open the viewer
Second click: close the viewer
But the second click does not correctly close the Viewer, as the method used to cancel the requests does not work.
This PR use modern API to cancel the requests. The requests are now correctly aborted, and the
openFile
method exit because the request call throws an exception.Fix #893
https://axios-http.com/docs/cancellation
https://developer.mozilla.org/en-US/docs/Web/API/AbortController