Skip to content

feat(isl): GitHub API optimization — caching, dedup, rate limit monitoring#93

Draft
sontiO wants to merge 6 commits intomainfrom
feature/github-api-optimization
Draft

feat(isl): GitHub API optimization — caching, dedup, rate limit monitoring#93
sontiO wants to merge 6 commits intomainfrom
feature/github-api-optimization

Conversation

@sontiO
Copy link
Copy Markdown

@sontiO sontiO commented Mar 4, 2026

Summary

  • Add in-memory TTL cache for GitHub API responses (PR summaries 5min, comments 10min, merge state 2min) — expected ~60-70% reduction in API calls
  • Deduplicate concurrent in-flight fetchAllPRData requests
  • Add rateLimit field to CombinedPRQuery GraphQL for monitoring, with low-rate warnings
  • Fix comment bleed when switching PRs in review mode (reset stale state on diffId change)
  • Invalidate comment cache after mutations (reply, add, edit, resolve, unresolve)
  • User-triggered refresh bypasses cache

Test Plan

  • 11 new GitHubCache unit tests (TTL, stale-while-revalidate, invalidation, prefix invalidation)
  • All 446 ISL tests pass
  • All isl-server tests pass (pre-existing TS type errors unchanged)
  • Manual: Open ISL, observe PR summaries load, wait 2+ min, verify no redundant API call
  • Manual: Click refresh, verify API call happens (force refresh bypasses cache)
  • Manual: Open review mode for PR, switch to different PR, verify no comment bleed
  • Manual: Add/edit comment, verify fresh data after refresh
  • Manual: Check server logs for rate limit info

🤖 Generated with Claude Code

sontiO and others added 6 commits March 4, 2026 10:51
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wraps PR summaries (5min TTL), comments (10min TTL), and merge state
(2min TTL) with cache. User-triggered refresh bypasses cache.
Expected ~60-70% reduction in API calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reset lastComments state when diffId changes so stale comments from the
previous PR don't briefly render while the new PR's comments are loading.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Clears all cached comments after reply, add, edit, resolve, and
unresolve mutations so the next fetch returns fresh data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant