GothenburgBitFactory / tasklib

A Python library for interacting with taskwarrior databases.
http://tasklib.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
148 stars 28 forks source link

Use new-uuid verbosity token for new task additions #101

Closed tbabej closed 3 years ago

tbabej commented 3 years ago

The mechanism for obtaining information about newly added task (also called refreshing) was a bit fragile in situations when the only reference to the new task object is an ID number.

In particular, if taskwarrior has some GC cleanup pending, and a new task is added through tasklib, the GC will be performed while exporting the information about the newly added task, thus changing the IDs and rendering the ID reference invalid.

This effect is now mitigated in two ways: 1.) We use the new-uuid (available since 2.4.0) verbosity token, which makes "task add" command output a UUID for the newly added task. 2.) The GC mechanism is disabled during refreshing. This will only be useful if a manual ID reference was used to get a task by the user.

Closes #97.