-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Support query.cancel() #1003
Support query.cancel() #1003
Conversation
Closes: #997 Taken from Android API [cancel](http://parseplatform.org/Parse-SDK-Android/api/com/parse/ParseQuery.html#cancel--) Can be improved in the future.
Codecov Report
@@ Coverage Diff @@
## master #1003 +/- ##
==========================================
+ Coverage 91.91% 91.94% +0.02%
==========================================
Files 53 53
Lines 5098 5114 +16
Branches 1145 1146 +1
==========================================
+ Hits 4686 4702 +16
Misses 412 412
Continue to review full report at Codecov.
|
@acinader @davimacedo This is hard to test in a node environment as the node-xmlhttprequest package (hasn't been published in 4 years) is lacking proper support for abort. i.e. every open connection calls abort when opened. This isn’t a problem for Parse.File cancel since it doesn’t use that package. Canceling queries is tricky. The RESTController does a few promises like installationId and currentUser before the request. The requestTask might not be set when cancel is called. I added an onchange event to know when the request started. We could move this to a query.onStart or something like that. It should work in browser though. |
@acinader @davimacedo I updated my comment. Thoughts? |
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.
if you think we should release this, given its limitations, is ok with me.
Closes: #997
Taken from Android API cancel
Can be improved in the future.