Skip to content

FIX: Indefinite fetch spinner#115

Merged
pol-rivero merged 2 commits into
pol-rivero:mainfrom
Jacko1394:fix-hang-on-spinner
Mar 30, 2026
Merged

FIX: Indefinite fetch spinner#115
pol-rivero merged 2 commits into
pol-rivero:mainfrom
Jacko1394:fix-hang-on-spinner

Conversation

@Jacko1394

Copy link
Copy Markdown

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 — the emitUpdate() method uses window.requestAnimationFrame() to batch UI state updates. On Windows, Chromium aggressively throttles requestAnimationFrame callbacks for unfocused windows (reducing them to ~1fps or stopping them entirely). There was already a bypass for hidden windows that calls emitUpdateNow() directly, but no bypass for unfocused-but-visible windows.

The fix expands the existing bypass condition from this.windowState === 'hidden' to this.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

  1. Open GitHub Desktop Plus with a repository that has commits to push (or a remote with commits to pull/fetch)
  2. Click the Push (or Pull/Fetch) button in the toolbar
  3. Immediately click away to a different window (e.g., a browser or file explorer) so GitHub Desktop Plus loses focus
  4. Wait for the operation to complete (observe network activity stopping)
  5. Notice the spinner continues spinning indefinitely in the taskbar preview / when glancing at the window
  6. Click back on the GitHub Desktop Plus window
  7. The spinner immediately stops and the correct post-operation state is shown

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

image image

Additional context

The fix is a single-line change in app/src/lib/stores/app-store.ts:1079. The emitUpdate() method already had a bypass for hidden windows that avoids requestAnimationFrame; this change extends it to also cover unfocused windows. The appIsFocused property is already reliably maintained by the existing Electron BrowserWindow focus/blur → IPC → renderer pipeline.

@pol-rivero

Copy link
Copy Markdown
Owner

LGTM, thank you!

@pol-rivero pol-rivero merged commit 6cf045f into pol-rivero:main Mar 30, 2026
@Jacko1394 Jacko1394 deleted the fix-hang-on-spinner branch March 30, 2026 05:44
@pol-rivero

Copy link
Copy Markdown
Owner

This is now available in v3.5.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants