Skip to content

Conversation

raunakab
Copy link
Contributor

@raunakab raunakab commented Jun 11, 2025

Description

This PR fixes how the replies: list[..] | None variable is processed. Previously, a None OR an empty list would hit the if-case and yield a ConnectorFailure. With this PR, only the former hits the if-case.

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

How Has This Been Tested?

Tests already written and are passing.

@raunakab raunakab requested a review from a team as a code owner June 11, 2025 01:10
Copy link

vercel bot commented Jun 11, 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 11, 2025 1:11am

@raunakab raunakab enabled auto-merge June 11, 2025 01:10
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

Modified Teams connector to improve message reply handling logic in backend/onyx/connectors/teams/connector.py, specifically addressing rate limiting concerns by distinguishing between None replies (failed retrievals) and empty replies (valid responses).

  • Updated condition in _collect_documents_for_channel from if cre or not replies to if cre or replies is None for more precise error detection
  • Change prevents false error reporting when messages legitimately have no replies
  • Helps handle rate limiting by treating None responses as failures while allowing empty reply lists

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

@raunakab raunakab added this pull request to the merge queue Jun 11, 2025
Merged via the queue into main with commit ce031c4 Jun 11, 2025
12 checks passed
@raunakab raunakab deleted the fix/teams branch June 11, 2025 03:17
AnkitTukatek pushed a commit to TukaTek/onyx that referenced this pull request Sep 23, 2025
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