VersionDeltaStreamV2
In comparison to the previous format for version deltas, this format is structured so that incompletely sent data can be detected.
Detecting incomplete data is a workaround for:
https://youtrack.jetbrains.com/issue/KTOR-6905/The-client-reads-incomplete-streamed-responses-without-failing In this case partial data from a request might be read without throwing an exception or indicating it with a correct return value
https://youtrack.jetbrains.com/issue/KTOR-4862/Ktor-hangs-if-exception-occurs-during-write-response-body Because Ktor server does not close the connection when an exception occurs while writing a body we always close the connection even if not all data was yet send (see ByteWriteChannel.useClosingWithoutCause).
The format sends redundant hashes because of previous bugs encountered with SHA1 calculation. See https://github.com/modelix/modelix.core/pull/213/commits/a412bc97765426fcc81db0c55516c65b8679641b