redux-toolkit icon indicating copy to clipboard operation
redux-toolkit copied to clipboard

[invalidatesTags] - Executed many requests instead of one

Open shalev312 opened this issue 1 year ago • 2 comments

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.
  • The Query is placed and called only in one place on the root of the page
  • The project is in React
Screenshot 2024-09-22 at 10 27 37 image image

shalev312 avatar Sep 22 '24 07:09 shalev312

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?

markerikson avatar Sep 22 '24 07:09 markerikson

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

shalev312 avatar Sep 22 '24 07:09 shalev312