Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose operations, including "historical" operations #474

Merged
merged 15 commits into from
Oct 27, 2024

Conversation

djmitche
Copy link
Collaborator

This stores all operations for all existing tasks, including operations that were entered on other replicas, and makes those available via get_task_operations. This functionality will support task info in TaskWarrior, and can support similar "task history" displays in other consumers.

As the last commit and the docstrings describe, this isn't perfect -- if there are conflicting operations, then the results may differ between replicas. But those are rare, and in practice this is sufficient to provide information to users. In particular, users who never task sync will see correct information.

This is a large diff, but broken up into commits, many of which were reviewed and landed previously, but backed out for the 0.8.0 release. Feel free to review commit-by-commit.

Fixes #373.

@djmitche djmitche requested a review from ryneeverett October 25, 2024 02:55
taskchampion/src/operation.rs Outdated Show resolved Hide resolved
taskchampion/src/operation.rs Outdated Show resolved Hide resolved
taskchampion/src/taskdb/sync.rs Outdated Show resolved Hide resolved
taskchampion/src/taskdb/sync.rs Show resolved Hide resolved
taskchampion/src/taskdb/sync.rs Outdated Show resolved Hide resolved
taskchampion/src/replica.rs Outdated Show resolved Hide resolved
taskchampion/src/storage/sqlite.rs Outdated Show resolved Hide resolved
This means tracking which operations have been synced, and a few details
such as not allowing removal of synced operations.
This ordering is exposed to the public API and will be useful for
presentation of changes to a task, such as those from
`get_task_operations`. It's also useful for tests!
This produces a usable "task history" in the form of operations
performed on a task.

This isn't perfect, and different replicas may see different sets of
operations when those operations conflict, but for purposes of
displaying a history of a task, this is adequate.
This is required because the non-sealed public trait `StorageTxn` added
new methods without a default implementation, which breaks downstream
implementations of the trait. No downstream implementations are known,
but a major version bump is necessitated all the same.
@djmitche
Copy link
Collaborator Author

I added commits for some of the comments, and updated existing commits for the minor bits (dbg!, mostly)

@djmitche djmitche merged commit 2ebab88 into GothenburgBitFactory:main Oct 27, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose operations from TaskChampion
2 participants