I have been playing with a proof of concept client written in TypeScript with node. My rough idea was to create a client that can download single files, rather than sync whole directories.
I have the client to the point where it is receiving Index messages from a syncthing server on port 22000. One thing that jumps out as not ideal is the inclusion of the Blocks (array of BlockInfo messages) field in the FileInfo message in the Index message. This list can be very large and cost a fair amount of bandwidth. It makes perfect sense if all files are always synchronized, which I accept is the use case for this protocol, but my client may not even want to download this file, so downloading the BlockInfo is a waste.
Is there a way we could separate the two messages? Maybe a field in the ClusterInfo I send that informs the server to not include them in the Index message it sends, then add a field in the Request message that asks for the BlockInfo?
This may all be impractical and there’s a fair chance I’m missed an important use case, but I thought it was worth floating the idea.