Replies: 1 comment
-
|
This is a well-known gap between how browser-based timer APIs work and how OS-level suspend/resume behaves, and it's especially sharp in Electron tray apps since there's no natural "window focus" event to bail you out. Root Cause
On top of that, Solution 1: Electron
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all!
I've been working on refactoring two existing tray/menubar Electron applications to use tanstack query.
These apps run mostly in the background / hidden state.
When configuring useQuery to
refetchIntervalandrefetchIntervalInBackground, it will work for the most part, fetching new server data at the defined interval, even when the renderer is not visible.That said, I've been having edge-case issues when waking devices that have hibernated for an extended period (ie: overnight). The background interval fetching seems to stop, only resuming after the first interaction with the tray/menubar app (note, i also have
refetchOnReconnectandrefetchOnWindowFocusset)Any tips would be welcomed. For the time being, i've reverted to using an out-of-band interval polling function that calls refetch
Beta Was this translation helpful? Give feedback.
All reactions