Perf/reduce GitHub api calls#11
Merged
Merged
Conversation
Add ReviewActionsControl component with a collapsible dropdown menu (matching Git/Jira action patterns) that appears when the current thread has an active PR review. Supports submitting APPROVE or REQUEST_CHANGES via the GitHub API, then auto-dismisses the review request locally.
- Cache findLatestPr results per (cwd, branch) with 60s TTL, avoiding 1-3 gh API calls every git status poll - Cache repository clone URLs for 5 minutes (essentially static data fetched up to 4x per PR worktree setup) - Cache PR head SHA for 2 minutes during review comment publishing - Increase git status polling from 15s to 30s (stale 5s to 15s) - Increase git branches polling from 60s to 120s (stale 15s to 30s) - Increase review request polling from 60s to 120s (stale 30s to 60s) - Invalidate PR cache on PR creation to ensure fresh data after mutations
- Extract createTtlCache to @t3tools/shared/cache (dedup GitManager + wsServer) - Cache getDefaultBranch results for 15 minutes (essentially static) - Server-side 60s cache for reviewRequestList (collapses multi-tab polls) - Batch review comments into single POST /reviews call (N→1 API calls) - Add refetchIntervalInBackground: false to all polled queries (stops polling when tab is in background) - Add refetchOnWindowFocus to reviewRequestListQueryOptions - Add stdin passthrough to GitHubCli.execute for batch API payloads
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.
Summary
directly via the GitHub API
Polling interval changes
Server-side caches
findLatestPrper (cwd, branch)gh pr listcalls per status pollgh repo viewper PR worktreeTest plan
ghAPI usage to confirm reduced call volume