perf(channels): refresh_cache merges fresh counts instead of re-listing all channels#10
Conversation
…ng all channels channels_list with refresh_cache=true used to force a synchronous re-list of every channel (conversations.list pagination under Tier-2 rate limiting) — ~55s for a ~1,800-channel workspace, and minutes when Slack throttles. Callers like the sde-automation Slack-unread page only need fresh unread counters, which a single client.counts edge call already provides. RefreshChannelCounts merges HasUnreads/LastRead/MentionCount from client.counts into the in-memory channels snapshot without touching the cache file, so the TTL clock keeps running and the existing stale-while-revalidate machinery still re-lists the full channel set in the background once the cache expires. When counts are unavailable (no edge client), the handler falls back to the old full synchronous refresh. Claude-Session: https://claude.ai/code/session_01JA39im4Ha2g7t4qdLg5Adt
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ 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 |
Summary
channels_listwithrefresh_cache=trueused to force a synchronous re-list of every channel (conversations.listpagination under Tier-2 rate limiting) — ~55s for a ~1,800-channel workspace, and minutes when Slack throttles. Callers like the sde-automation Slack-unread page only need fresh unread counters, which a singleclient.countsedge call already provides.RefreshChannelCountsmergesHasUnreads/LastRead/MentionCountfromclient.countsinto the in-memory channels snapshot without touching the cache file, so the TTL clock keeps running and the existing stale-while-revalidate machinery still re-lists the full channel set in the background once the cache expires. When counts are unavailable (no edge client), the handler falls back to the old full synchronous refresh.Testing
ErrCountsUnavailablefallback signal, and cache-TTL expiry detection (pkg/provider/api_counts_refresh_test.go).channels_list refresh_cache=truedropped from ~55s to 0.2s; server log confirms the counts path ran with no fallback and no full re-list.https://claude.ai/code/session_01JA39im4Ha2g7t4qdLg5Adt