reduxjs / redux-toolkit

The official, opinionated, batteries-included toolset for efficient Redux development
https://redux-toolkit.js.org
MIT License
10.69k stars 1.17k forks source link

[invalidatesTags] - Executed many requests instead of one #4637

Open shalev312 opened 2 weeks ago

shalev312 commented 2 weeks ago

Way to introduce:

  1. Config get request on the page (for example 'home' page)
  2. Config others get requests on the same page (for example 'home' page)
  3. Config action that invalidates the cache using the 'invalidatesTags' configuration
  4. Use the action that invalidates the cache on the same 'home' page
  5. The get request calls many times.
Screenshot 2024-09-22 at 10 27 37 image image
markerikson commented 2 weeks ago

Afraid this isn't enough information to understand what might be going on. Can you provide a CodeSandbox or a repo that shows this happening?

shalev312 commented 2 weeks ago

I will create an example later and will update it here :)

Also, I verified "@reduxjs/toolkit": "1.9.5" and "react-redux": "8.1.3", and there the issue does not show up