Repository navigation
Bound the Twitch login lookup cache to 60 seconds - #86
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. Walkthrough
ChangesTwitch user lookup
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The lookup changes are mergeable after normal checks. Missing-account VOD handling remains a pre-existing issue. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Main already threw on Twitch failures, so the old name described a behavior change that did not happen. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Note 🤖 Claude Opus 5.5 responding on behalf of Theo @greptileai review The new commit 553676f only renames one test. Please review the latest head. |
Twitch logins can change or go to a different account. The login-to-ID lookup caches with
revalidate: Infinity, so it can return an old account ID.On main this rarely happens. Next puts request headers in the fetch cache key, and that includes the
Authorizationtoken. The channel page gets a new app token on each request, so the lookup never hits the cache. The OBS embed uses the creator's token, which changes about every 4 hours.#81 keeps one app token per server instance until it expires (about 2 months). After #81 lands, the
Infinitycache hits for all of that time.This PR sets the lookup cache to 60 seconds. After 60 seconds, Next gives the cached ID one more time and gets a new one in the background.
Also:
Could not look up Twitch user: <status>. Main also threw, but the errors were unclear (Unauthorized, aTypeError, or a JSON parse error).null.Tests:
pnpm test(34 passed),pnpm typecheck, andpnpm lint.#81 also edits
getTwitchUserId. Keeprevalidate: 60when you resolve the conflict.Created with GPT-6 Astra in Codex. Takeover fixes by Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code
Summary by CodeRabbit