Skip to content

focusThrottleInterval is not honoured for the first refresh on focus after mount #2856

@mgoodfellow

Description

@mgoodfellow

Bug report

Description / Observed Behavior

It seems that sometimes focusThrottleInterval is not honoured

Expected 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:

image

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions