GothenburgBitFactory / task-timewarrior-hook

MIT License
5 stars 0 forks source link

Hook Error: Expected 1 JSON task(s), found 0, in hook script: on-modify.timewarrior, if a task description are large #15

Open Erraen opened 3 years ago

Erraen commented 3 years ago

on-modify.timewarrior hook are fault on large (10kB+) task description (redminedescription in my case, but I think it does not matter). Adding a flush option to the output of the task fixes the problem:

print(json.dumps(new), flush=True)

Versions: timewarrior - 1.4.2 OS - Debian 11 python - 3.9.1

k4y4k commented 3 years ago

Yeah, this is happening to me too on any task brought in by bugwarrior (be it GitHub, GitLab, Trello, whatever), and I can confirm replacing https://github.com/GothenburgBitFactory/timewarrior/blob/c83d45bc0d47bb362e96edfb5cf44cabe1f0b6d9/ext/on-modify.timewarrior#L50 with

print(json.dumps(new), flush=True)

fixes the issue.