Repository navigation
fix: prevent UI deadlock in GitHub widget - #2117
Merged
Seanstoppable merged 1 commit intoJul 24, 2026
Merged
Seanstoppable merged 1 commit into
Seanstoppable merged 1 commit into
Conversation
Move all HTTP calls out of the display/content path into Refresh(), so that keyboard handlers and tview draw operations never block on network I/O. This fixes the UI freeze that occurs when: - The GitHub API is slow or unresponsive - enableStatus is true (N sequential HTTP calls per PR) - Multiple widgets compete for the single-buffered redrawChan Changes: - github_repo.go: Add context.WithTimeout (30s) to all API calls, pre-compute and cache review requests, pull requests, and custom query results during Refresh() - display.go: content() now reads only cached fields (zero HTTP) - widget.go: Pass settings (username, enableStatus, customQueries) to Repo.Refresh() so it can pre-fetch everything - text_widget.go: Make RedrawChan send non-blocking to prevent goroutine stalls when the channel buffer is full - base.go: Same non-blocking fix for ShowHelp()
Seanstoppable
force-pushed
the
seanstoppable-fix-github-widget-deadlock
branch
from
July 23, 2026 03:12
f8740f1 to
4dd1c7c
Compare
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.
Problem
The GitHub widget can freeze the UI due to HTTP calls happening in the display/rendering path. When keyboard handlers (
h/l/r) triggercontent(), it callsmyPullRequests()→individualPRs()which makes N sequential HTTP requests, blocking the tview event loop. Combined withcontext.Background()(no timeouts) and a blockingRedrawChansend, this can lock up the entire UI.Fix
content():Repo.Refresh()now pre-fetches and caches all display data (CachedMyPullRequests,CachedMyReviewRequests,CachedCustomQueries).content()reads only cached fields — zero network calls.context.WithTimeout(30s)instead ofcontext.Background().Redraw()andShowHelp()useselect/defaultto avoid goroutine stalls when the channel buffer is full.repo == nilcheck moved before any method calls onrepo.Testing
Tested with
enableStatus: trueand multiple repositories. Source switching (h/l) is now instant and manual refresh (r) no longer freezes the UI.