Visitar URL original
fix(session): session.invoke running through a loop of length zero by ViktoriaSchubert42 · Pull Request #81 · hydrogram/hydrogram · GitHub
Skip to content

fix(session): session.invoke running through a loop of length zero - #81

Open
ViktoriaSchubert42 wants to merge 1 commit into
hydrogram:devfrom
ViktoriaSchubert42:dev
Open

ViktoriaSchubert42 wants to merge 1 commit into
hydrogram:devfrom
ViktoriaSchubert42:dev

Conversation

@ViktoriaSchubert42

Copy link
Copy Markdown

In 'hydrogram/session/session.py' in the session's class function 'invoke' the function is executing a while loop over the amount of retries, which is defined as 'retries: int = MAX_RETRIES,'(line424). Using 'hydrogram/methods/bots/request_callback_answer.py' defines the retries as: 'retries=0,', meaning that an action should be executed once without retrying. The problem is that in session's invoke function, the loop is over the number of retries, not the number of actual tries + retries. A variable 'tries = retries + 1' was added and the while loop is now running over the number of tries, which shall always be 1 actual try plus the number of retries, not just the number of retries that was set

>
> In 'hydrogram/session/session.py' in the session's class function 'invoke' the function is executing a while loop over the amount of retries, which is defined as 'retries: int = MAX_RETRIES,'(line424). Using 'hydrogram/methods/bots/request_callback_answer.py' defines the retries as: 'retries=0,', meaning that an action should be executed once without retrying. The problem is that in session's invoke function, the loop is over the number of retries, not the number of actual tries + retries. A variable 'tries = retries + 1' was added and the while loop is now running over the number of tries, which shall always be 1 actual try plus the number of retries, not just the number of retries that was set
@a0xz

a0xz commented Sep 26, 2026

Copy link
Copy Markdown

@alissonlauffer, please review this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants