You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
MS Teams rate limiting is not handled well and does not raise an exception. MS unfortunately chose to respond to rate limited requests with a 200 status code, only including the 429 error in the response body.
It would be fantastic if this library would raise a TeamsWebhookException if a 429 error is found in the response body, help avoid the trap I'm sure a lot of people fall into, assuming MS would pick sensible response codes.
To Reproduce
Steps to reproduce the behaviour:
Trigger MS Teams webhook rate limit (default 4 requests/sec)
Receive a 200 OK response but with a 429 error in the response body
Standard request code raise_for_status or HTTP troubleshooting example, does not detect rate limiting, as it relies on status code
Watch your application log 200's and leave you non-the-wiser
Expected behavior
MS choosing to respond with a 200 is unfortunate and non-sensical but something I'd hope a library like this would account for.
The text was updated successfully, but these errors were encountered:
It's not only Rate Limit, I got more errors for example:
Status: True
Response: <Response [200]>
Content: b'Webhook message delivery failed with error: Microsoft Teams endpoint returned HTTP error 500 with ContextId...'
Status: True
Response: <Response [200]>
Content: b'System.Net.Http.HttpRequestException: Error while copying content to a stream.'
Describe the bug
MS Teams rate limiting is not handled well and does not raise an exception. MS unfortunately chose to respond to rate limited requests with a 200 status code, only including the 429 error in the response body.
It would be fantastic if this library would raise a TeamsWebhookException if a 429 error is found in the response body, help avoid the trap I'm sure a lot of people fall into, assuming MS would pick sensible response codes.
To Reproduce
Steps to reproduce the behaviour:
Expected behavior
MS choosing to respond with a 200 is unfortunate and non-sensical but something I'd hope a library like this would account for.
The text was updated successfully, but these errors were encountered: