Disable fetch on focus


Mar 27, 2023

ACCEPTED

Alessandro Menduni

#frontend #data #react-query

Context

react-query by default re-fetches active queries on window focus. This causes the UI to activate its loading animations, if there's any. This is a good behaviour for a PWA or other specific type of data visualizion, but it's less relevant for PCUI.

Decision

We disabled this default behaviour, and will activate on a per-query basis in case of need.

Consequences

Data needs to intentionally refreshed either by developers or by users via an appropriate Refresh button.