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.
Current Behavior:
  • 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.
Steps to Reproduce:
  1. Navigate to the resource.
  2. Click the "Create" button to open the modal.
  3. Observe the network requests initiated.
  4. Close the modal or click away from it.
  5. Observe additional fetch requests being triggered.
320276010-24c535ee-831f-4161-acc5-31c5dde360ba.png
Was this page helpful?