Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Clear deleted" on a many tickes could result in "list index out of range" #1

Open
runborg opened this issue Mar 14, 2024 · 1 comment

Comments

@runborg
Copy link
Contributor

runborg commented Mar 14, 2024

Version: 0.9.20

When clearing out a lot of closed tickets with the "Y" command, the code could fail with a list index out of range.

  File "/home/runarb/.local/bin/curitz", line 8, in <module>
    sys.exit(main())
  File "/home/runarb/.local/pipx/venvs/curitz/lib/python3.10/site-packages/curitz/cli.py", line 1182, in main
    curses.wrapper(uiloop, config)
  File "/usr/lib/python3.10/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/runarb/.local/pipx/venvs/curitz/lib/python3.10/site-packages/curitz/cli.py", line 404, in uiloop
    runner(screen, config)
  File "/home/runarb/.local/pipx/venvs/curitz/lib/python3.10/site-packages/curitz/cli.py", line 866, in runner
    lb.draw()
  File "/home/runarb/.local/pipx/venvs/curitz/lib/python3.10/site-packages/curitz/culistbox.py", line 69, in draw
    if isinstance(self.elements[i], BoxElement):
IndexError: list index out of range```

This might because of the current "page" of tickets is beeing deleted, or something like that. 
I've not debugged the issue other than found it happening when cleaning a lot of tickets when debugging zino2
@runborg
Copy link
Contributor Author

runborg commented Mar 14, 2024

It looks like the issue is with the current "page" not existing after the delete operation completes. if the cursor is on a page beeing deleted after the removal operation it will give this error. if the cursor is on a page not deleted it works as expected.

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

No branches or pull requests

1 participant