Multiple Unexpected Fetch Requests Triggered When Closing Modal After Create Action
Package
Actions
Package Version
v3.2
How can we help you?
Problem:
I have a simple resource with a create action. To enhance user experience, I've disabled the create page route and instead made the action open in a modal.
Expected Behavior:
- Upon clicking the "Create" button, it should trigger a single fetch request for creating the resource.
- Closing the modal or clicking away should not trigger additional fetch requests.
- Users should be able to open the modal again without waiting for any pending requests to finish.
- Clicking the "Create" button initiates a fetch request named "update".
- Upon closing the modal or clicking away, two more identical fetch requests are triggered, causing unnecessary load and preventing the modal from reopening until all three requests are completed.
- These fetch requests take some time, significantly slowing down the app especially if the user has a slow network.
- Navigate to the resource.
- Click the "Create" button to open the modal.
- Observe the network requests initiated.
- Close the modal or click away from it.
- Observe additional fetch requests being triggered.
