iachat/lib/integrations/slack
Muhsin Keloth 6c6aaf573c
fix: Optimize Slack channel fetching to avoid rate limiting issues (#12542)
### Problem
The Slack integration fails when fetching channels from workspaces with
many channels due to rate limiting errors. The current implementation
makes a single API call requesting both public and private channels
simultaneously with `types: 'public_channel,private_channel'`, which
causes Slack's API to apply complex filtering and hit rate limits more
frequently.

  When testing with a csutomer workspace containing 157 channels:
- Combined request: Hit rate limits after a few pages, required 22+ API
calls with long delays
- Separate requests: Private channels (1 channel) load instantly, public
channels (185 channels) load quickly
  
 
  ### Solution

  Split the channel fetching into two sequential steps:
1. **Fetch private channels first** with `limit: 1000` (expects very
few)
  2. **Fetch public channels second** with pagination as needed

This approach leverages the fact that Slack's API handles single-type
requests much more efficiently than mixed-type requests, avoiding the
rate limiting issues entirely while maintaining the same functionality.
2025-09-29 14:41:48 +05:30
..
channel_builder.rb fix: Optimize Slack channel fetching to avoid rate limiting issues (#12542) 2025-09-29 14:41:48 +05:30
hook_builder.rb feat: move Slack config to installation settings (#11548) 2025-05-23 01:07:35 -07:00
incoming_message_builder.rb chore: Handle duplicate Webhooks from slack (#9187) 2024-04-04 17:00:45 +05:30
link_unfurl_formatter.rb feat: Slack link unfurling (#7940) 2023-09-29 19:35:56 +05:30
send_on_slack_service.rb feat: Add support for grouped file uploads in Slack (#12454) 2025-09-24 11:31:06 +05:30
slack_link_unfurl_service.rb feat: Slack link unfurling (#7940) 2023-09-29 19:35:56 +05:30
slack_message_helper.rb chore: Handle duplicate Webhooks from slack (#9187) 2024-04-04 17:00:45 +05:30