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(client): raise InvalidToken if the token expires while using lock() #134

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

palazzem
Copy link
Owner

Related Issues

Proposed Changes:

lock() method uses the @contextmanager decorator that doesn't propagate inner exception. If a 401 response is received (the token is expired), that error is not propagated above and it causes the token to not get refreshed until the next poll(). In a real scenario where you have delays, it means it's very likely that you can't interact with the system unless you hit the exact window between one refresh and another.

Testing:

Acquire a token, let it expire, call lock()

Extra Notes (optional):

n/a

Checklist

  • Related issues and proposed changes are filled
  • Tests are defining the correct and expected behavior
  • Code is well-documented via docstrings

@palazzem palazzem added this to the 0.9.2 milestone Dec 20, 2023
@palazzem palazzem self-assigned this Dec 20, 2023
@coveralls
Copy link

Pull Request Test Coverage Report for Build 7278102786

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 7115497080: 0.0%
Covered Lines: 392
Relevant Lines: 392

💛 - Coveralls

@palazzem palazzem merged commit b9abfdd into main Dec 20, 2023
3 checks passed
@palazzem palazzem deleted the palazzem/issue-117 branch December 20, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants