Skip to content

Conversation

raunakab
Copy link
Contributor

@raunakab raunakab commented Jun 9, 2025

Description

This PR adds rate-limiting to API requests made to MS Teams.

Addresses: https://linear.app/danswer/issue/DAN-2063/add-rate-limiting-to-ms-teams-connector-apis.

How Has This Been Tested?

The only way to test this would be through scale-testing, which we don't have just yet.

@raunakab raunakab marked this pull request as ready for review June 9, 2025 17:12
@raunakab raunakab requested a review from a team as a code owner June 9, 2025 17:12
Copy link

vercel bot commented Jun 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 8:12pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Added rate limiting to MS Teams connector API requests to prevent hitting service limits, specifically for message replies fetching.

  • Implemented rate limiting decorator in backend/onyx/connectors/teams/connector.py to restrict Teams API calls to 50 requests per 60 seconds
  • Should consider adding scale testing infrastructure to properly validate rate limiting behavior
  • Lack of testing capabilities for rate limiting implementation poses potential risk

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

@raunakab raunakab enabled auto-merge June 9, 2025 18:23
Copy link
Contributor

@evan-onyx evan-onyx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some nits

@raunakab raunakab added this pull request to the merge queue Jun 10, 2025
@evan-onyx evan-onyx removed this pull request from the merge queue due to a manual request Jun 10, 2025
@raunakab raunakab enabled auto-merge June 10, 2025 20:10
@raunakab raunakab added this pull request to the merge queue Jun 10, 2025
Merged via the queue into main with commit 0ded581 Jun 10, 2025
10 of 12 checks passed
@raunakab raunakab deleted the fix/teams-rate-limiting branch June 10, 2025 22:12
AnkitTukatek pushed a commit to TukaTek/onyx that referenced this pull request Sep 23, 2025
* Add rate-limiting to Teams API request

* Add comment for rate-limiting

* Implement rate-limiting for office365 library.

* Remove hardcoded value

* Fix nits on PR
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.

3 participants