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(dotnet-sdk): Fix broken rate limit handling #493

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Hawxy
Copy link

@Hawxy Hawxy commented Feb 17, 2025

Description

This unhelpfully deadlocked my test pipeline today. This code hasn't been touched for 3 years and has always been broken as far as I can tell. The tests also made the incorrect assumption about the header shape.

In the test suite, change the header configuration to:
response.Headers.Add(RateLimitParser.RateLimitHeader.LimitResetIn, DateTimeOffset.UtcNow.AddSeconds(10).ToUnixTimeSeconds().ToString());

And the assertion to:
Assert.InRange(error.ResetInMs!.Value, 0, 10000);

References

Closes openfga/dotnet-sdk#76

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

@Hawxy Hawxy requested a review from a team as a code owner February 17, 2025 08:57
Copy link

linux-foundation-easycla bot commented Feb 17, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

@Hawxy Hawxy marked this pull request as draft February 17, 2025 09:44
@Hawxy Hawxy marked this pull request as ready for review February 17, 2025 09:50
@rhamzeh
Copy link
Member

rhamzeh commented Feb 18, 2025

Thanks @Hawxy!

If you don't mind - will do some changes to your PR as we want to move from supporting these old headers to supporting the standard Retry-After header.

Related issues:

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.

Incorrect interpretation of x-ratelimit-reset for Okta
2 participants