server-core: cache + share the team GitHub snapshot (2.5min TTL, SWR) - #68
Merged
Merged
Conversation
…shot Activity(15s) and board(30s) dashboard polls each call fetchTeamGitHubSnapshot separately, so every cycle could spawn up to 4 gh processes costing 10-35s each on slow-DNS networks. Adds a per-repoPath cache (TTL 150_000ms, matching the fetchGitHubPRStatus cache) at the fetchTeamGitHubSnapshot boundary: a fresh miss awaits the live fetch, a hit within TTL returns instantly, and a stale hit returns the stale snapshot immediately while kicking a single-flight background refresh (concurrent callers share it; a failed refresh just leaves the stale entry in place). The transport internals (fetchTeamIssues, fetchTeamPRs) are untouched so this composes with the in-process gh-transport rewrite. Closes #66 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
fetchTeamGitHubSnapshot(packages/server-core/src/github-team.ts) with a 150_000ms TTL, matching thefetchGitHubPRStatuscache bumped in af80ddc.fetchTeamGitHubSnapshotUncached) and its transport internals (fetchTeamIssues,fetchTeamPRs,ghexec plumbing) are untouched — the cache wraps the existing boundary so it composes cleanly with the in-process transport rewrite tracked in dashboard: replace gh/git-remote spawns with in-process GitHub REST fetch (keep-alive) #67.Test plan
bun test src/github-team.test.ts— 19 pass, 0 fail, covering: fresh miss awaits, TTL hit returns cached without spawning, stale hit returns stale + exactly one refresh under concurrent calls, refresh failure keeps serving stale.bun run typecheckinpackages/server-core— passes.Closes #66
🤖 Generated with Claude Code