diff --git a/CHANGELOG.md b/CHANGELOG.md index 8744821..9bb4411 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Each release entry covers the motivation, new features, breaking changes (if any | Version | Blog post | | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- | +| [v1.8.1](https://fulll.github.io/github-code-search/blog/release-v1-8-1) | Fix silent hang after pagination bar — concurrency cap + progress bar for line-number resolution | | [v1.8.0](https://fulll.github.io/github-code-search/blog/release-v1-8-0) | Purple TUI theme, fetch progress bar, position indicator, line-anchored file links, Esc to close help | | [v1.7.0](https://fulll.github.io/github-code-search/blog/release-v1-7-0) | Shell completions (bash/zsh/fish) + extended syntax highlighting (PHP, C/C++, Swift, Terraform/HCL, Dockerfile) | | [v1.6.1](https://fulll.github.io/github-code-search/blog/release-v1-6-1) | Fix TUI only displaying first text fragment when a file has multiple matches | diff --git a/docs/blog/index.md b/docs/blog/index.md index 4a0c327..a0f63c6 100644 --- a/docs/blog/index.md +++ b/docs/blog/index.md @@ -11,6 +11,7 @@ Full release notes and changelogs are always available on | Release | Highlights | | -------------------------- | ---------------------------------------------------------------------------------------------------------- | +| [v1.8.1](./release-v1-8-1) | Fix silent hang after pagination bar — concurrency cap + progress bar for line-number resolution | | [v1.8.0](./release-v1-8-0) | Purple TUI theme, fetch progress bar, position indicator, line-anchored file links, Esc to close help | | [v1.7.0](./release-v1-7-0) | Shell completions (bash/zsh/fish), extended syntax highlighting (PHP, C/C++, Swift, Terraform, Dockerfile) | | [v1.6.1](./release-v1-6-1) | Fix TUI rendering only the first fragment for multi-match files | diff --git a/docs/blog/release-v1-8-1.md b/docs/blog/release-v1-8-1.md new file mode 100644 index 0000000..2a22ba5 --- /dev/null +++ b/docs/blog/release-v1-8-1.md @@ -0,0 +1,69 @@ +--- +title: "What's new in v1.8.1" +description: "Bug fix: the CLI no longer hangs silently for up to 2 minutes after the pagination bar, especially on slow or mobile networks." +date: 2026-03-09 +--- + +# What's new in github-code-search v1.8.1 + +> Full release notes: + +## Highlights + +### Fix: silent hang after pagination bar on slow networks + +After the `Fetching results from GitHub…` progress bar completed, the CLI could +freeze silently for **up to 2 minutes** before the interactive TUI appeared. +No spinner, no message — the terminal looked stuck. The hang was consistently +worse on tethering or congested networks and could sometimes be resolved by +re-running on a better connection. + +#### Root cause + +The GitHub Code Search API returns only fragment-relative character indices — +there are no absolute line numbers in the response. To display accurate line +numbers in the TUI, `github-code-search` fetches the raw content of each +matched file from `raw.githubusercontent.com` after pagination completes. + +Two compounding issues caused the hang: + +1. **No concurrency limit.** With 200+ unique files in the results, 200+ + HTTP requests fired simultaneously via `Promise.all`. On a saturated + network this overwhelmed the connection pool and caused the event loop + to stall. + +2. **No progress feedback.** The user saw nothing between the end of the + pagination bar and the TUI — no indication that work was still in + progress. + +#### What changed + +- **Concurrency capped at 20** parallel requests (new `concurrentMap` helper + in `api-utils.ts`). This dramatically reduces the load on the network + connection and prevents the stall pattern on mobile networks. +- **Per-request 5 s timeout** via `AbortSignal.timeout`. If a raw file + fetch stalls, it is silently abandoned and line numbers fall back to + fragment-relative values — results still appear, just without precise + absolute line numbers for that file. +- **New progress bar** shown on stderr during the resolution phase: + + ``` + Resolving line numbers… ▓▓▓▓▓▓▓░░░░░░░░░░░░░ 23/67 + ``` + + The line is erased cleanly before the TUI launches, leaving a clean + terminal. + +**Before:** silent freeze, up to 2 minutes on tethering. +**After:** steady progress bar, TUI opens within seconds on any network. + +--- + +## Upgrade + +```bash +github-code-search upgrade +``` + +Or download the latest binary directly from the +[GitHub Releases page](https://github.com/fulll/github-code-search/releases/tag/v1.8.1). diff --git a/package.json b/package.json index cabffde..87e07af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github-code-search", - "version": "1.8.0", + "version": "1.8.1", "description": "Interactive GitHub code search with per-repo aggregation", "keywords": [ "bun",