Skip to content

fix(matrix): throttle room history backfill requests#2249

Open
webguru-hypha wants to merge 1 commit into
mainfrom
fix/matrix-history-rate-limit-backoff
Open

fix(matrix): throttle room history backfill requests#2249
webguru-hypha wants to merge 1 commit into
mainfrom
fix/matrix-history-rate-limit-backoff

Conversation

@webguru-hypha

Copy link
Copy Markdown
Contributor

Summary

  • throttle Matrix room history backfill to prevent request spikes during chat initialization
  • add bounded retry with rate-limit backoff when homeserver returns M_LIMIT_EXCEEDED
  • stop backfill early when recent history is already loaded for the room

Test plan

  • pnpm --filter @hypha-platform/core test
  • pnpm exec prettier --check packages/core/src/matrix/client/providers/matrix-provider.tsx
  • Manual review of loadRoomHistory flow for cooldown + adaptive stop conditions

Made with Cursor

Reduce room-history request bursts with smaller batches, adaptive stop conditions, and 429 retry backoff to prevent M_LIMIT_EXCEEDED during chat initialization.
@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@webguru-hypha has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 33 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d6b6f37d-8685-4669-aa81-ddcb28f01325

📥 Commits

Reviewing files that changed from the base of the PR and between 1c1063c and f879f4d.

📒 Files selected for processing (1)
  • packages/core/src/matrix/client/providers/matrix-provider.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/matrix-history-rate-limit-backoff

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

🔗 Custom preview URL: https://pr-2249.preview-app.hypha.earth

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.

1 participant