Skip to content

Bugfix/discord rate limiting#249

Open
intagliated wants to merge 10 commits intoOpen-ACP:mainfrom
intagliated:bugfix/discord-rate-limiting
Open

Bugfix/discord rate limiting#249
intagliated wants to merge 10 commits intoOpen-ACP:mainfrom
intagliated:bugfix/discord-rate-limiting

Conversation

@intagliated
Copy link
Copy Markdown

Implement proper rate limit handling for Discord API requests to prevent 429 errors.

Changes

  • Add DiscordRateLimiter class with request bucketing
  • Add DiscordClient with full Discord API integration
  • Add automatic retry on 429 rate limit responses
  • Add comprehensive unit tests (9 tests total)
  • Add GitHub Actions workflow for CI

Testing

  • ✅ 6 unit tests passing (request bucketing, delay, cleanup, stats)
  • ✅ 3 edge case tests (zero limits, large intervals, concurrency)
  • ✅ Rate limit simulation verified locally
  • ⏳ Live Discord integration test pending (requires bot token)

Related Issue

Closes #240

intagliated added 10 commits May 2, 2026 20:52
- 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 Open-ACP#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 Open-ACP#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 Open-ACP#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Discord Rate Limiting

1 participant