Skip to content

Incorrect behaviour of retries in network_retry_loop #4871

@harshil21

Description

@harshil21

It seems that we increment retries for every loop iteration, even if the callback succeeded and there were no errors from the TG API:

finally:
retries += 1

This conflicts with the logic of checking the number of retries done:

except TelegramError as telegram_exc:
if on_err_cb:
on_err_cb(telegram_exc)
if max_retries < 0 or retries < max_retries:

It also seems that we don't reset retries = 0 when there are no errors returned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions