Repository navigation
fix(desktop): remove server-side status cache that caused stale sidebar data - #1568
Conversation
…ar data The 2s server-side cache in getStatus returned stale git state after mutations (stage, unstage, commit, etc.) since refetch() hit the cache before it expired. The 2.5s client-side polling interval already rate-limits queries, making the server cache unnecessary.
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughThis pull request removes server-side caching from the getStatus endpoint in the changes router. The STATUS_CACHE_TTL_MS constant, statusCache instance, and cache lookup/storage logic are eliminated, causing the function to always compute and return a fresh GitChangesStatus object instead of serving cached results. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
getStatusquery had a 2-second server-side cache that returned stale git state after mutations (stage, unstage, commit, push, etc.)refetch(), the server returned cached data because the TTL hadn't expiredChanges
apps/desktop/src/lib/trpc/routers/changes/status.ts: Removed thestatusCacheMap,STATUS_CACHE_TTL_MSconstant, and all cache read/write logic fromgetStatusTest Plan
Summary by CodeRabbit