Bundling delete mutations with Promise.all doesn't work after 15.1.3 release
See original GitHub issueDescribe the bug
This was working on version 15.1.2:
const { mutate: deleteExample } = useMutate({
verb: 'DELETE',
path: `/examples`,
});
Promise.all(selection.map(id => deleteExample(id))).then(() => {
console.log('success')
});
In version >= 15.1.3, this results in all requests being canceled.
To Reproduce
Just bundle 2 or more delete mutations inside Promise.all
.
Expected behavior
All DELETE requests should be successful and Promise.all
should be resolved.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Handling errors in Promise.all - Stack Overflow
Promise.all is all or nothing. It resolves once all promises in the array resolve, or reject as soon as one of them rejects....
Read more >rails_migration[gitlab-rails] Error executing action run from ee ...
Ok, I can reproduce the problem when the the max ID of issues < the max_value of the BackfillIssueSearchData issues: Yeah, I guess...
Read more >firebase - UNPKG
node_modules/core-js/modules/es.promise.all-settled.js","../. ... node_modules/core-js/internals/collection-delete-all.js","../.
Read more >The Racket Guide - Northwestern University PLT
Alternately, use a full path to racket after #! (with a space between #! and the path), in which case the user's executable...
Read more >Developer Guide Red Hat Data Grid 7.0
Red Hat JBoss Data Grid provides the following programmable APIs: ... the server will not launch a map/reduce operation to retrieve keys from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I guess the original idea was that restful-react intentionally has the cancellation policy baked in: if any of the
props
change -> previous request cancelled -> new request fired. Such behaviour seems legit to me and useful for most use cases.It could indeed be a nice additional feature though: separate flag to disable request cancellation.
It works! Also, congrats on this awesome project. Great time saver!