Bugfix/discord rate limiting#249
Conversation
- Add Session interface with SessionStatus type - Add VALID_STATUSES constant (active, completed, expired, cancelled) - Add filterSessionsByStatus controller function - Add unit tests with 4 test cases for filter logic
- Add DiscordRateLimiter class with request bucketing - Add GitHub Actions workflow for rate limit testing - Add simulation script for retry logic verification - Implements rate limit detection and exponential backoff Addresses #240
- Add DiscordClient with full API integration - Add rate limiting wrapper for all Discord endpoints - Add automatic retry on 429 responses - Add example usage and tests - Add environment variable template Closes #240
- Add DiscordRateLimiter class with request bucketing - Add DiscordClient with real Discord API integration - Add automatic retry on 429 rate limit responses - Add comprehensive unit tests (6 tests) - Add edge case tests (3 tests) - Update package.json, package-lock.json, and .gitignore Features: - Per-endpoint rate limit tracking - Exponential backoff retry logic - Automatic cleanup of old requests - Stats reporting for monitoring Testing: ✅ 6 unit tests passing ✅ 3 edge case tests passing Addresses #240
- Add proper Node.js matrix strategy - Install dependencies correctly - Run unit tests and edge cases separately - Fix path patterns for PR triggers
- Switch to pnpm (project uses pnpm-lock.yaml) - Update actions to v4 (Node.js 24 compatible) - Add proper dependency installation steps
|
Hey @intagliated, thanks for digging into this and taking a shot at the rate limiting issue — it's a real pain point and we appreciate the initiative! We do have a few concerns we'd like to walk through before this can be merged. The fix is in the right area, but the wrong repo OpenACP's Discord integration lives in a separate repo:
The discord-adapter uses A couple of implementation notes (for future reference)
The This adds ~5300 lines to the PR, but the project uses One other thing The PR also includes session controller code ( Suggested next step We'd suggest:
Thanks again for the effort on this — really do appreciate it! Feel free to reach out if you'd like to pair on where exactly the fix should go. 🙌 |
|
sure, will check that out |
Implement proper rate limit handling for Discord API requests to prevent 429 errors.
Changes
DiscordRateLimiterclass with request bucketingDiscordClientwith full Discord API integrationTesting
Related Issue
Closes #240