GothenburgBitFactory / GothenburgBitFactory/taskchampion
If DB is empty and there is no snapshot, there is no error
- Dominant language
- Rust
- Stars
- 184
- Forks
- 41
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 7
Description
In the relatively unusual case where there are versions but no snapshot on the server, the new-replica-initialization code does not return an error:
https://github.com/GothenburgBitFactory/taskchampion/blob/01e11c36b78a332264f3d393bec68fe7572d6a5f/src/taskdb/sync.rs#L21-L28
In fact, given the current server API, it's not possible for the replica to determine whether it is working with an empty server or a server with no snapshot.
I can see two ways to handle this:
- Update spec and the server implementations to return an error when there are versions present but no snapshot; or
- Add a new GetLatestVersion method to the spec and service implementations. If there is no snapshot and that value is not the nil UUID, then taskdb can treat that as an error with an explanatory error message.
This bug came from https://github.com/GothenburgBitFactory/taskwarrior/issues/4123
Contributor guide
Assessment
This issue has not been assessed yet.