Open
Description
Issue description
Whenever there is a pending query on some endpoint 'A', invalidation of cache (re-fetch when subscribed) on endpoint 'B' is only triggered when the endpoint 'A' query finishes.
Consider a scenario where you have two queries getPosts and getMyPosts. Let's assume that getPosts takes around 25 seconds to finish and getMyPosts returns data immediately (200ms).
Steps to reproduce:
- Subscribe to getPosts and getMyPosts
- invalidate getMyPosts after a couple of seconds (while getPosts query is still pending)
Expected result:
- my posts data is re-fetched right after the invalidation (delayed as a task/microTask)
Actual result:
- my posts data is re-fetched only when the getPosts query finishes
"@reduxjs/toolkit": "2.2.1",
"react-redux": "9.1.0",
"redux": "5.0.1"