Repository navigation
feat: pause polling while locked or suspended - #3590
Merged
Merged
Conversation
Emit SYSTEM_SLEEP from powerMonitor suspend and lock-screen events, track a session power state in Zustand, and gate notification and account refetch intervals on it. Wake and unlock resume polling with one immediate refetch; duplicate wake events share the in-flight fetch.
setchy
marked this pull request as ready for review
November 1, 2026 21:31
Spell out hidden-window, offline, and lock/suspend behavior instead of saying the previous behavior is unchanged.
|
Contributor
|
🎉 This pull request is included in Gitify v8.0.0! 🎉 Downloads for macOS, Windows, and Linux are available on the release page. Thanks for helping make Gitify better! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Part of OpenSpec change
04-clean-up-dependencies-and-electron-debt(tasks 3.1–3.5 and 6.1).SYSTEM_SLEEPevent frompowerMonitorsuspendandlock-screen; keep the existingSYSTEM_WAKEevents onresumeandunlock-screen.usePowerStateStoreand ausePowerStatesubscription mounted inGlobalEffects.refetchIntervals on the power state.refetch({ cancelRefetch: false })so they share the in-flight fetch.ARCHITECTURE.md.Polling behavior
refetchIntervalInBackgroundkeeps the timers running.networkMode: 'online'), and the notifications screen shows the offline state; on reconnect they resume, and the online state is re-probed on wake.SYSTEM_SLEEPdisables the query intervals;SYSTEM_WAKEre-enables them and triggers an immediate refetch of the notification and account queries (cancelRefetch: false) before the normal intervals resume.Verification
pnpm checkpasses.Notes
Draft for review. Based on
main; #3587 has merged, and #3588 still touches the same events/preload/system-handler area, so expect a small conflict if #3588 lands first.