Skip to content

query.shouldContinueRetryOnFocus is never reset once a previously failed query succeeds again #528

@hippotastic

Description

@hippotastic

If one of my queries fails at one point (e.g. because the backend server is unreachable for a while), the following line sets query.shouldContinueRetryOnFocus to true:

https://github.com/tannerlinsley/react-query/blob/66f462c2f9552ca2bbda8ac0fd7595bdb1a4008e/src/queryCache.js#L400

If this flag is true, the query gets refetched every time the window is focused.

However, you seem to have forgotten to delete this flag once the query succeeds again. This causes the query to be refetched on every window focus event, even if it's perfectly fresh and not stale.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions