-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(cdp): cache slack channel responses #33583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Size Change: +29 B (0%) Total Size: 1.83 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Implements caching for Slack channel responses to prevent rate limiting issues when users configure multiple Slack destinations for a single workspace.
- Added 60-minute caching for Slack channel lists in
posthog/api/integration.py
while keeping channel-specific lookups uncached - Added new
action
feature infrontend/src/lib/lemon-ui/LemonInputSelect
to support 'Refresh channels' button with 5-minute cooldown - Updated
frontend/src/lib/integrations/slackIntegrationLogic.ts
to includelastRefreshedAt
timestamp andforceRefresh
parameter - Modified
frontend/src/lib/api.ts
to handle cache control viaforceRefresh
parameter and return timing information - Implemented cache isolation by integration ID and private channel access state
5 files reviewed, 5 comments
Edit PR Review Bot Settings | Greptile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really nice. Way more full-featured than I would have done 😅 🙌
Important
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Problem
We are starting to get some rate limit issues when trying to fetch Slack channels
https://us.posthog.com/project/2/error_tracking/6e6650b3-7b15-4396-a6d7-70c38fb035de
Usually it's a single customer who is trying to configure multiple Slack destinations for a single workspace (insight).
Changes
Inspired by Zapier
Did you write or update any docs for this change?
How did you test this code?