extensions
extensions copied to clipboard
[Taskwarrior] fails to parse task JSON after upgrading to Taskwarrior v3.0, if you leave the old .data files behind
Extension
https://www.raycast.com/yosy2010/raytaskwarrior
Raycast Version
1.75.2
macOS Version
14.5
Description
After upgrading to Taskwarrior v 3.0.2 and exporting/importing tasks to the new database format, the Raycast integration can no longer list my tasks:
- The error message is misleading: the path to
taskis unchanged and set correctly:
~► which task
/opt/homebrew/bin/task
Instead, I believe that the JSON is no longer parsing correctly with the new version of Taskwarrior. The error appears to be coming from line 23 in the api.ts file (upstream).
const data = JSON.parse(stdout) as Task[];
if (data) tasks = data.sort((a, b) => b.urgency - a.urgency);
} catch (error) {
throw new Error("Please make sure you have set the path to task in the settings");
Version 3.0 of Taskwarrior is a breaking change. The format of the task database was changed, but this should be transparent to the extension.
I think what has happened is that the task command will display this warning, which is breaking the extension:
~► task export rc.json.array:on > tasks.json
Found existing '.data' files in /Users/mjl/net/MEGA/task
Taskwarrior's storage format changed in 3.0, requiring a manual migration.
See https://github.com/GothenburgBitFactory/taskwarrior/releases.
Configuration override rc.json.array:on
Workaround
- Remove the
.datafiles from your taskwarrior data directory
Steps To Reproduce
- In a system which has upgraded from Taskwarrior v2.x to v3.x, and has
.datafiles left from the export/import - Run the command "List Active Tasks"
- See error in Description
- Run the
taskcommand executed by the extension from a terminal - See the error message displayed by
task - Remove the
.datafiles as advised - Extension working as expected
Current Behaviour
The extension errors with "Please make sure you have set the path to task in the settings" even when the path is correct
Expected Behaviour
The extension should either explicitly state there was a problem parsing the JSON output by task (rather than assume all errors are because of a misconfiguration), or produce the error thrown by the command in some sort of pop-up display, for the user to diagnose and fix.
Thank you for opening this issue!
🔔 @AltamimiYasser you might want to have a look.
💡 Author and Contributors commands
The author and contributors of yosy2010/raytaskwarrior can trigger bot actions by commenting:
@raycastbot close this issueCloses the issue.@raycastbot rename this issue to "Awesome new title"Renames the issue.@raycastbot reopen this issueReopens the issue.@raycastbot assign meAssigns yourself to the issue.@raycastbot good first issueAdds the "Good first issue" label to the issue.@raycastbot keep this issue openMake sure the issue won't go stale and will be kept open by the bot.
I have this problem with a fresh install of Taskwarrior (3.0.2). task does not display any errors, there is no .data file I could remove to work around this bug. The path is set correctly in the extension.
@uhkeller Could you try running the task command which the Taskwarrior Raycast extension is running, to see what error it produces? That could reveal what the problem actually is. I suspect that if you don't have a .data file, then you did not upgrade from an earlier Taskwarrior, so you might have a different problem.
task export rc.json.array:on > tasks.json
(disclaimer: I am not the extension's creator/maintainer)
Thanks for your response, @sinewalker. There is no error when running this command, just the override message Configuration override rc.json.array:on. If I disable override messages in .taskrc the message is gone from terminal output put the extension still doesn't work.
EDIT: Very weirdly, the extension intermittently does work (in about 50% of attempts) and displays my list of tasks while also showing the error message.
How strange!
I wonder whether there is something causing a delay that the extension doesn't wait for? (I'm just guessing now).
Is your data.location on a network volume or something which might be intermittently slow? If so, try moving it locally and see if it helps. If not... I don't know
Strange indeed. No, the data are in the default location on my SSD. I'll try to find some time to properly debug this next week.
I've decided to downgrade to Taskwarrior 2 until taskwarrior-flutter and/or WingTask have caught up with TW 3. This also solves my Raycast problem for now.
This issue has been automatically marked as stale because it did not have any recent activity.
It will be closed if no further activity occurs in the next 10 days to keep our backlog clean 😊
This issue has been automatically closed due to inactivity.
Feel free to comment in the thread when you're ready to continue working on it 🙂
You can also catch us in Slack if you want to discuss this.