tbabej / vit

Placeholder to demostrate issue porting for VIT.
0 stars 0 forks source link

[VT-18] fatal error when starting vit with no tasks #18

Open tbabej opened 6 years ago

tbabej commented 6 years ago

Brian Bove on 2013-10-10T19:57:07Z says:

When trying to start vit for the first time (and having no current tasks in taskwarrior), I received the following message:

Fatal error: default.command ("next") must print an "ID" column

I was able to get around this by first creating a new task from the command line:

$ task add test

After this, vit started up just fine.

The version I have was installed on archlinux using yaourt and the AUR. I noticed that someone in the comments section of the AUR page had hit the same bug a few months ago, but I didn't see that anyone had created a report for the issue.

If any more information is needed, let me know and I'll be happy to provide it.

tbabej commented 6 years ago

Migrated metadata:

Created: 2013-10-10T19:57:07Z
Modified: 2014-02-09T01:16:50Z
tbabej commented 6 years ago

David Patrick on 2013-10-10T22:26:27Z says:

This problem is not unique to vit startup, but any time task issues a dialog (error, confirmation, anything) vit has no notion of how to deal with it. I think the easiest solution is to have task dialogs and error messages interrupt vit and "shell-out", allowing the user to respond, or at least see the messages.

tbabej commented 6 years ago

Brian Bove on 2013-10-11T01:35:23Z says:

While I have to admit that I don't understand the entire startup process, nor the message/error handling when it comes to task, I wonder if it suffice for now to print a message at least in the case where a new user has no current tasks. At least this way someone new to the application isn't immediately thrown off due to error messages. I'm not sure if this would be the only instance (no tasks) where $default_command="next" would cause problems, but it's a thought.

if ( $default_command eq "next"){
    print "No tasks currently exist. Create one with 'task add taskname'\n";
}
else{
    print "Fatal error: default.command (\"$default_command\") must print an \"ID\" column\n";
}
exit(1);
tbabej commented 6 years ago

David Patrick on 2013-10-11T03:45:50Z says:

..it has nothing to do with "next" specifically, but in any case where the result doesn't start with ID, as is the case where task responds with anything other than the expected, ID-leading output, as will happen when task throws an error, or requires input (y/n).

tbabej commented 6 years ago

Scott Kostyshak on 2013-10-12T04:13:26Z says:

I agree with djp. I don't like hardcoding the "next" report because this is a problem with every report. Further, one can customize the Next report to not show an ID in which case your message would say "no tasks" when in fact the problem is "no ID column". I like your suggestion in general though and might think of a way to tweak it for a short-term fix.

Here were my comments through email (a reminder to myself when I come back to this bug):

Thanks for the report. This is indeed a bug in VIT (although note that Taskwarrior is not to blame here), and in my opinion it is not a small one because it can be the first thing that people see when they use VIT. That's not a good first impression to make.

However, it's a bug at the core of VIT, having to do with how it processes data. VIT parses the output of Taskwarrior and in this case Taskwarrior is just returning "No matches." So VIT has no idea what columns to display. It could have an idea, if it were intelligent enough to look them up in 'task show' for example. And then it could just display the VIT screen with empty columns. I think this is what is expected by the user.

I will look into fixing this but unfortunately it probably won't make it into VIT 1.2.