pyrogram
pyrogram copied to clipboard
Infinite iteration for "get_chat_history" with negative offset
Checklist
- [X] I am sure the error is coming from Pyrogram's code and not elsewhere
- [X] I have searched in the issue tracker for similar bug reports, including closed ones
- [X] I ran
pip3 install -U https://github.com/pyrogram/pyrogram/archive/master.zipand reproduced the issue using the latest development version
Description
When i set offset -1 i get infinite iteration with timeout at the end. First message repeats infinitly.
Steps to reproduce
- Create test chat
- Get chat history with negative offset
Code example
async def main():
async with app:
message: types.Message
async for message in app.get_chat_history(TEST_CHAT_ID, offset=-1):
print(message.date)
Logs
(.venv) PS C:\src\convyfeed> python.exe .\main.py
2022-09-16 19:39:25
2022-09-16 19:39:15
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
2022-09-16 19:38:45
[convyfeed] Waiting for 28 seconds before continuing (required by "messages.GetHistory")