Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: inconsistence in 429 handling between sync/async client #131

Conversation

evansims
Copy link
Member

@evansims evansims commented Sep 20, 2024

Description

This change addresses inconsistencies between the sync and async clients when encountering HTTP status codes 429 or 400 in an HTTP response.

References

Closes #129

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

@evansims evansims added the bug Something isn't working label Sep 20, 2024
@evansims evansims linked an issue Sep 20, 2024 that may be closed by this pull request
6 tasks
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 69.13%. Comparing base (e2ce832) to head (4915b57).

Files with missing lines Patch % Lines
openfga_sdk/rest.py 0.00% 2 Missing ⚠️
openfga_sdk/sync/rest.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #131      +/-   ##
==========================================
- Coverage   69.16%   69.13%   -0.03%     
==========================================
  Files         121      121              
  Lines        9982     9986       +4     
==========================================
  Hits         6904     6904              
- Misses       3078     3082       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@evansims evansims marked this pull request as ready for review September 20, 2024 03:49
@evansims evansims requested a review from a team as a code owner September 20, 2024 03:49
Copy link
Member

@ewanharris ewanharris left a comment

Choose a reason for hiding this comment

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

Looks good!

I don't think we should handle in this PR as it might prove a larger task, but I wonder if we could move down a level in our mocking for tests as it seems we're mocking this request function currently which means we miss code like this.

@evansims evansims added this pull request to the merge queue Sep 20, 2024
Merged via the queue into main with commit 32d0aff Sep 20, 2024
16 checks passed
@evansims evansims deleted the 129-the-sync-client-does-not-retry-at-all-if-the-server-responds-with-a-429 branch September 20, 2024 17:56
@evansims evansims mentioned this pull request Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The sync client does not retry at all if the server responds with a 429
4 participants