You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we review this waterfall, we have filtered requests by "cat" so we see the requests for this URL.
We can see the request on the page load, then we see another request ~10s. Surely the focusThrottleInterval should have inhibited this 2nd request from occuring?
The text was updated successfully, but these errors were encountered:
The nextFocusRevalidatedAt is only calculated after the initial focus revalidation. So we end up with this issue where the first throttle interval is always ignored.
This effect is then repeated on a remount (such as due to a page change).
I guess ideally we need to calculate the next possible revalidation window due to focus, when it initially mounts.
This uses the built libraries from the PR I opened above, and the behaviour is now as expected:
That initial refresh does not occur, and then the refresh on focus after 60s is allowed
mgoodfellow
changed the title
focusThrottleInterval is not honoured all the time
focusThrottleInterval is not honoured for the first refresh on focus after mount
Dec 12, 2023
Bug report
Description / Observed Behavior
It seems that sometimes
focusThrottleInterval
is not honouredExpected Behavior
I expected it to be honoured
Repro Steps / Code Example
https://github.com/mgoodfellow/swr_revalidate_test
Additional Context
SWR version 2.2.4
Add any other context about the problem here
Run repo with
npm run dev
Page loads, cat fact shown.
Click away from window (lose focus)
Wait ~ 10 seconds, click back to window:
If we review this waterfall, we have filtered requests by "cat" so we see the requests for this URL.
We can see the request on the page load, then we see another request ~10s. Surely the focusThrottleInterval should have inhibited this 2nd request from occuring?
The text was updated successfully, but these errors were encountered: