Office365-REST-Python-Client icon indicating copy to clipboard operation
Office365-REST-Python-Client copied to clipboard

`execute_query_retry` in `client_runtime_context.py` may leave the context in a dirty state

Open npetzall-vcc opened this issue 10 months ago • 0 comments

https://github.com/vgrem/Office365-REST-Python-Client/blob/9584c62c9c4237107fb5ab2dc11629b8f1184b57/office365/runtime/client_runtime_context.py#L43-L71

If the last attempt fails with a ClientRequestException it will still re-queue the query. But it will never consume it, since line 63 would never be called again. Unless the context is re-used and the query would be executed for a different item which could cause all sorts of issues.

Since there is no exception/error raised when max attempts have been performed. This dirty state is unknown unless failure callback is implemented to keep track of this, clear() is called after each use or context is re-created after each use.

npetzall-vcc avatar Feb 10 '25 10:02 npetzall-vcc