gtg icon indicating copy to clipboard operation
gtg copied to clipboard

Creating an incomplete subtask with the `-` bullet list symbol may result in an AttributeError (no attribute 'get_parents') on a nonexistent object on startup

Open Disaster2life opened this issue 2 years ago • 2 comments

I was just creating some tasks and this popped up, and it now seems to do that everytime I press backspace? I haven't restarted GTG yet, but I might after this to see if it persists **Context:** Global generic exception

Traceback (most recent call last):
  File "/app/lib/python3.9/site-packages/GTG/gtk/editor/taskview.py", line 200, in process
    if self.detect_subtasks(text, start):
  File "/app/lib/python3.9/site-packages/GTG/gtk/editor/taskview.py", line 302, in detect_subtasks
    parents = task.get_parents()
AttributeError: 'NoneType' object has no attribute 'get_parents'

Software versions:

  • Getting Things GNOME! v0.6
  • CPython 3.9.9 (main, Nov 10 2011, 15:00:00) [GCC 11.3.0]
  • GTK 3.24.34, GLib 2.70.5
  • PyGLib 3.42.2, PyGObject 3.42.2
  • Linux-5.19.6-200.fc36.x86_64-x86_64-with-glibc2.33`

Disaster2life avatar Sep 08 '22 10:09 Disaster2life

Update, I think I fixed it without needing to restart, it seemed that having an open "-" for writing a task without anything next to it except the @ tags at the end of the task and that seemed to be conflicting

Disaster2life avatar Sep 08 '22 10:09 Disaster2life

Interestingly enough, I encountered the same sort of issue recently when GTG unexpectedly crashed (for the first time ever) while doing some subtask creation/typing in a task, and I don't know exactly how I triggered it. It somehow didn't end up in any major problem, though I had to re-write my sub-tasks for it after restarting the app.

If you manage to figure out step-by-step reproduction instructions for this, this would be a good thing to test for when Diego's refactoring changes land in master eventually. Maybe this kind of torture case could even be part of a test suite somehow.

nekohayo avatar Sep 08 '22 17:09 nekohayo

I'm not 100% sure this is the same bug, but it's on the same line, and here's a repro for v0.6:

  1. Open GTG. Press [+] to create a new task.
  2. Add a sub-task within the window.
  3. Add another sub-task under the first one.
  4. Indent the second sub-task so it's no longer highlighted.
  5. Un-indent the second subtask.
  6. Error is triggered.

Video is below:

https://user-images.githubusercontent.com/732166/204119944-45a8061a-39da-48d2-a4c4-a010a3e04fb6.mp4

scovetta avatar Nov 27 '22 05:11 scovetta