question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bundling delete mutations with Promise.all doesn't work after 15.1.3 release

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mpotomincommented, Apr 16, 2021

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.

1reaction
dcruzincommented, May 3, 2021

It works! Also, congrats on this awesome project. Great time saver!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found