Open umonaca opened 2 years ago
https://github.com/tuya/tuya-iot-python-sdk/blob/83f1e999d75ef87b2170ffbbb239ca8651dab0c3/tuya_iot/openapi.py#L144
But is_connect() never check if the token is expired.
is_connect()
Besides, this bug needs more than a one-line fix. You have another hidden problem in your code:
__request() => __refresh_access_token_if_need() => post() => __request() => __refresh_access_token_if_need()
Currently the loop breaks because of is_connect() == True. However, you should be aware that once you fix the bug mentioned above, you must also check whether path.startswith(TO_C_REFRESH_TOKEN_API).
is_connect() == True
path.startswith(TO_C_REFRESH_TOKEN_API)
Any update on that ?
No, there are several pull requests that would solve this issue, however, any of developers won't even reject them.
https://github.com/tuya/tuya-iot-python-sdk/blob/83f1e999d75ef87b2170ffbbb239ca8651dab0c3/tuya_iot/openapi.py#L144
But
is_connect()
never check if the token is expired.Besides, this bug needs more than a one-line fix. You have another hidden problem in your code:
Currently the loop breaks because of
is_connect() == True
. However, you should be aware that once you fix the bug mentioned above, you must also check whetherpath.startswith(TO_C_REFRESH_TOKEN_API)
.