GothenburgBitFactory / taskchampion-sync-server

The sync server for Taskchampion
MIT License
44 stars 8 forks source link

Add a `GetLatestVersionId` transaction to the sync protocol #4

Open djmitche opened 8 months ago

djmitche commented 8 months ago

The current sync protocol supports GetChildVersion, which can be used to iterate through versions from parent -> child. And, it supports AddVersion, which adds a new version if its parent is the latest version. But there's no way to find out what the latest version is.

That would be useful when getting changes from the server. There are two scenarios that look OK to the client, but are actually errors:

(In fact, in terms of the sync code these are exactly the same situation -- iteration stops, but the replica is not up to date)

A GetLatestVersionId transaction would simply return the latest version id. The client can make this transaction after it has finished iterating with GetChildVersion. If iteration didn't stop with the latest version id, then things have gone wrong and it should fail with an error.

djmitche commented 7 months ago

This is a good idea, but I don't think it's blocking 3.0