feat(fetch): header-exact backoff, workdir watch, PR-list throttle#9
Merged
Merged
Conversation
…throttle Header-exact backoff: the avatar API path (ureq) now reads Retry-After / X-RateLimit-Reset / RateLimit-Reset on a 403/429 and emits `rate-limited` with the precise seconds, so the UI pauses exactly as long as the provider asks instead of the CLI-error string heuristic's 15-min fallback. On such a cutoff we also stop negative-caching un-scanned authors (they'd wrongly show Gravatar for the negative-TTL). CLI errors (gh/glab/git) still use the confirmed text match. Workdir watch: the FS watcher now also watches the working tree, gitignore- filtered (is_relevant_change), so an external editor save refreshes the WIP list live - while build dirs (node_modules, target, dist) churning stay ignored and can't spam refreshes. Paths are canonicalised for the macOS /private symlink. PR-list throttle: the background loop lists PRs/MRs at a coarser cadence (PR_REFRESH_MS) than the cheap git fetch, since it spawns a gh/glab subprocess and hits the API bucket. Focus/return and user ops still list immediately. The background-refresh decision logic (fetch gate, watcher-echo grace, PR cadence, backoff window) is extracted into pure predicates in refreshPolicy.ts and unit-tested, plus real GitHub/GitLab/git rate-limit strings locked as regression tests for isRateLimited. Settings copy notes the new defaults.
|
🎉 This PR is included in version 0.31.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Follow-ups from the auto-refresh work, in order.
Header-exact rate-limit backoff
The avatar API path (
ureq) readsRetry-After/X-RateLimit-Reset/RateLimit-Reseton a 403/429 and emits arate-limitedevent with the precise seconds; the UI pauses exactly that long instead of the CLI-string heuristic's 15-min fallback. On such a cutoff we also stop negative-caching un-scanned authors (they'd otherwise show Gravatar for the whole negative-TTL). CLI errors (gh/glab/git) keep the text heuristic - now confirmed against real provider output and locked as regression tests (GitHub primary/secondary, GitLab/git 429, abuse-detection; not plain 403/network;429word-boundaried).Workdir watch for instant WIP
The FS watcher now also watches the working tree, gitignore-filtered (
is_relevant_change): an external editor save refreshes the WIP list live, while build dirs (node_modules, target, dist) churning stay ignored so they can't spam refreshes. Paths canonicalised for the macOS/privatesymlink.ponytail:note left re: Linux inotify watch-count on huge trees.PR-list throttle
Background loop lists PRs/MRs at a coarser cadence (
PR_REFRESH_MS = 15min) than the cheap git fetch - PR-list spawns a gh/glab subprocess + hits the API bucket. Focus/return and user ops still list immediately.Testable wiring
Background-refresh decisions (fetch gate, watcher-echo grace, PR cadence, backoff window) extracted into pure predicates (
src/refreshPolicy.ts) that RepoView calls, and unit-tested. Settings copy updated for the new defaults.Verify
backoff_secsprecedence/clamp/fallback;is_relevant_changegit-state vs workdir vs gitignored vs out-of-tree; watcher still fires on.gitwrite + idempotent. 67 pass, 0 warnings.refreshPolicypredicates (15), real rate-limit strings,extendBackoff. 76 pass, tsc + build clean.Notes
.gitignorechange (ignoregraphify-out/) is intentionally not in this branch - kept local per instruction./verifypass is still the outstanding "NOW" item.https://claude.ai/code/session_01RVF5LSdTyciWKY1k5sedU8