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

handling of tasks with multiple parents needs improving #425

Open
jmtd opened this issue Feb 8, 2023 · 1 comment
Open

handling of tasks with multiple parents needs improving #425

jmtd opened this issue Feb 8, 2023 · 1 comment

Comments

@jmtd
Copy link
Contributor

jmtd commented Feb 8, 2023

This is not intended to be a duplicate of #75 (I.e. I am not requesting that taskwiki fully supports multiple parent tasks), but, an observation that the current approach to handling the situation where a task has mutltiple dependencies needs significant improvement.

I'm using neovim 0.8.1, python3-tasklib 2.5.1-3,
taskwarrior 2.6.2+dfsg-1,
taskwiki from the master branch (c8e379f from 2022-10-19)
and vimwiki (584f073a2809232d4793b19689da3d4d708fe4f7 from the 'dev' branch).

I exclusively manipulate the taskwarrior tasks via taskwiki. I don't use any other front end. Right now (and in the past too), I have somehow ended up with a task having multiple parents. So despite the deliberate lack of support for this in taskwiki, it's possible to somehow arrange for that to happen by stumbling around.

When it does happen, various aspects of taskwiki become completely unusable. For example Backlog query
in my case is = | +redhat status:pending =, results in a large backtrace in an error buffer (familiar I'm sure but reproduced for convenience)

Error invoking 'python_execute' on channel 3 (python3-script-host):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/jon/.vim/plugged/taskwiki/taskwiki/errors.py", line 26, in wrapped_function
    original_function(*args, **kwargs)
  File "/home/jon/.vim/plugged/taskwiki/taskwiki/decorators.py", line 10, in wrapped_function
    original_function(*args, **kwargs)
  File "/home/jon/.vim/plugged/taskwiki/taskwiki/main.py", line 64, in update_to_tw
    c.evaluate_viewports()
  File "/home/jon/.vim/plugged/taskwiki/taskwiki/cache.py", line 247, in evaluate_viewports
    port.sync_with_taskwarrior()
  File "/home/jon/.vim/plugged/taskwiki/taskwiki/viewport.py", line 400, in sync_with_taskwarrior
    sort.TaskSorter(self.cache, self.tasks, self.sort).execute()
  File "/home/jon/.vim/plugged/taskwiki/taskwiki/sort.py", line 37, in execute
    child.parent = node
    ^^^^^^^^^^^^
  File "/home/jon/.vim/plugged/taskwiki/taskwiki/sort.py", line 154, in parent
    raise ValueError("TaskCollectionNode %s cannot have multiple parents" % repr(self))

I think this needs improving in two distinct ways

  1. a subset of the tasks in my taskwarrior DB are the problem. Taskwiki should make it much easier to figure out which are the troublesome issues.
  2. the rest of the issues that this query would return are absolutely fine. Rather than erroring out on the whole query, it would be better, IMHO, to process the rest, shouting loudly only about the trouble tasks.

Thanks

@jmtd
Copy link
Contributor Author

jmtd commented Feb 8, 2023

An additional note,

    raise ValueError("TaskCollectionNode %s cannot have multiple parents" % repr(self))

I'm not seeing the thrown exception, I'm only seeing the backtrace leading up to the throwing of the exception.

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