Skip to content

IndexError: list index out of range with a lot of starred repos #26

@GitGitro

Description

@GitGitro

Hi!
i was tinkering with this bot and loving it so far but i encountered an error while adding my starred repos as i have a lot of them. Here is the error:

Traceback (most recent call last):

  File "/usr/local/lib/python3.12/site-packages/telegram/ext/_application.py", line 1325, in process_update

    await coroutine

  File "/usr/local/lib/python3.12/site-packages/telegram/ext/_handlers/basehandler.py", line 158, in handle_update

    return await self.callback(update, context)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/app/app/telegram_bot.py", line 342, in button

    await self.add_starred_repos(chat_id, github_user, update.callback_query.get_bot())

  File "/app/app/telegram_bot.py", line 307, in add_starred_repos

    await self.add_repo(chat_id, repo, bot, True)

  File "/app/app/telegram_bot.py", line 255, in add_repo

    store_latest_release(db.session, repo, repo_obj)

  File "/app/app/repo_engine.py", line 80, in store_latest_release

    prerelease = repo.get_releases()[0]

                 ~~~~~~~~~~~~~~~~~~~^^^

  File "/usr/local/lib/python3.12/site-packages/github/PaginatedList.py", line 77, in __getitem__

    return self.__elements[index]

           ~~~~~~~~~~~~~~~^^^^^^^

IndexError: list index out of range

also maybe a flag to do it silently instead of posting every added repo would a nice to have feature, only a notification when finished. But that's a plus, up to you.

if you need more logs/environment setup etc. feel free to ask.
Thank you!

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