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
[x] Related issues and proposed changes are filled
[x] Tests are defining the correct and expected behavior
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 nextpoll()
. 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