FIX: Indefinite fetch spinner#115
Merged
Merged
Conversation
Owner
|
LGTM, thank you! |
Owner
|
This is now available in v3.5.7 |
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.
The problem
When performing push, pull, or fetch operations on Windows, if the user clicks away to a different window (unfocusing GitHub Desktop Plus) while the operation is in progress, the loading spinner on the toolbar button spins indefinitely. The operation itself completes successfully in the background, but the UI never updates to reflect completion. The spinner immediately stops and the correct state is shown the moment the user clicks back on the GitHub Desktop Plus window.
The root cause is in
app/src/lib/stores/app-store.ts— theemitUpdate()method useswindow.requestAnimationFrame()to batch UI state updates. On Windows, Chromium aggressively throttlesrequestAnimationFramecallbacks for unfocused windows (reducing them to ~1fps or stopping them entirely). There was already a bypass forhiddenwindows that callsemitUpdateNow()directly, but no bypass for unfocused-but-visible windows.The fix expands the existing bypass condition from
this.windowState === 'hidden'tothis.windowState === 'hidden' || !this.appIsFocused, so state updates are emitted synchronously when the window is not focused. This is safe because most background subsystems (RepositoryIndicatorUpdater, PullRequestUpdater, CommitStatusStore) are already paused when the app loses focus, meaning very few updates occur in the unfocused state.Release version
3.5.7-beta2
Operating system and distro
Windows 10 / Windows 11
Steps to reproduce the behavior
Specific to GitHub Desktop Plus?
No. This issue also affects the official GitHub Desktop app. The root cause is in upstream code (emitUpdate() in app-store.ts) which uses requestAnimationFrame for state update batching. While initially observed during worktree usage, investigation confirmed that worktrees use the exact same push/pull/fetch code paths as regular repositories — the bug affects all repository types equally when the window is unfocused on Windows.
Log files
N/A — the issue is a UI rendering/update problem, not an error. No errors appear in logs.
Screenshots
Additional context
The fix is a single-line change in
app/src/lib/stores/app-store.ts:1079. TheemitUpdate()method already had a bypass for hidden windows that avoidsrequestAnimationFrame; this change extends it to also cover unfocused windows. TheappIsFocusedproperty is already reliably maintained by the existing ElectronBrowserWindowfocus/blur → IPC → renderer pipeline.