The public API of the taskchampion crate now contains the expected parts
and no more, and has some better documentation.
This moves the crate's external `tests/` into internal tests, as the
TaskDB is no longer exposed as part of the crate API.
This abandons field-by-field compatibility with the TaskWarrior TDB2
format, which wasn't a sustainable strategy anyway.
Instead, tasks are represented as a TaskMap with custom key formats. In
this commit, there are only a few allowed keys, with room to grow.
Replica returns convenience wrappers Task (read-only) and TaskMut
(read-write) with getters and setters to make modifying tasks easier.
This refactors the working-set support so that taskdb knows how to
rebuild the working set (in a single transaction) but replica knows what
tasks should be in that set.
This also adds support for automatically adding tasks to the working set
when they are marked pending. Note that tasks are not *removed* from
the working set automatically, but only on a gc operation.
Due to not accounting for the leading "P", getNextRecurrence would always return the same datetime, breaking all generic "PnM" periods and leading to an infinite loop in generateDueDates.
The test was failing because it expected "Created task 1"
but it saw "Created task 0a436fd8-7f06-4168-a66d-bbc940498af9".
Instead, the new code looks at the description of task 1.
This fixes a regression was introduced in
4e80d5d5fd.
Currently, if a user (with default configuration) adds a completed or
deleted task, they do not get a confirmation message ("Created task
..."). This is due to the fact that:
a) new-uuid is not set by default
b) new-id is set by default, but only prints message if the added task
is in pending or waiting state
Make sure to print a message containing UUID reference if the newly
added task is in completed or deleted state.
This fixes a regression was introduced in
4e80d5d5fd.
Currently, if a user (with default configuration) adds a completed or
deleted task, they do not get a confirmation message ("Created task
..."). This is due to the fact that:
a) new-uuid is not set by default
b) new-id is set by default, but only prints message if the added task
is in pending or waiting state
Make sure to print a message containing UUID reference if the newly
added task is in completed or deleted state.