{"record":{"id":"ee298f1ce4fe60f8","repo":"kovidgoyal/kitty","slug":"the-checksum-was-not-received-at-the-end-of-the-de","errorCode":null,"errorMessage":"The checksum was not received at the end of the delta data","messagePattern":"The checksum was not received at the end of the delta data","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"tools/rsync/api.go","lineNumber":189,"sourceCode":"\t\treturn err\n\t}\n\tself.unconsumed_delta_data = utils.ShiftLeft(self.unconsumed_delta_data, consumed)\n\treturn\n}\n\n// Finish applying delta data\nfunc (self *Patcher) FinishDelta() (err error) {\n\tif err = self.UpdateDelta([]byte{}); err != nil {\n\t\treturn err\n\t}\n\tif len(self.unconsumed_delta_data) > 0 {\n\t\treturn fmt.Errorf(\"There are %d leftover bytes in the delta\", len(self.unconsumed_delta_data))\n\t}\n\tself.delta_input = nil\n\tself.delta_output = nil\n\tself.unconsumed_delta_data = nil\n\tif !self.rsync.checksum_done {\n\t\treturn fmt.Errorf(\"The checksum was not received at the end of the delta data\")\n\t}\n\treturn\n}\n\n// Create a signature for the data source in src.\nfunc (self *Patcher) CreateSignatureIterator(src io.Reader, output io.Writer) func() error {\n\tvar it func() (BlockHash, error)\n\tfinished := false\n\tvar b [BlockHashSize]byte\n\treturn func() error {\n\t\tif finished {\n\t\t\treturn io.EOF\n\t\t}\n\t\tif it == nil { // write signature header\n\t\t\tit = self.rsync.CreateSignatureIterator(src)\n\t\t\tbin.PutUint16(b[:], 0)\n\t\t\tbin.PutUint16(b[2:], uint16(self.Checksum_type))\n\t\t\tbin.PutUint16(b[4:], uint16(self.Strong_hash_type))","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/tools/rsync/api.go#L171-L207","documentation":"FinishDelta requires a trailing checksum record in every delta stream. This error means the stream ended without the patcher having received its final checksum, so output integrity could not be verified.","triggerScenarios":"The delta was truncated before the final checksum operation, or a custom delta producer omitted the checksum terminator.","commonSituations":"Partial network transfer, a sender bug that doesn't emit the checksum, or calling FinishDelta before the last chunk arrived.","solutions":["Confirm the sender's delta iterator ran to completion (its final checksum write included)","Re-transfer the delta and apply again","If generating deltas yourself, always emit the trailing checksum before finishing"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := patcher.FinishDelta(); err != nil { do not trust output; restart transfer from a fresh signature }","preventionTips":["Never use patched output when FinishDelta errors — integrity is unverified","Always let the sender flush the trailing checksum record"],"tags":["rsync","protocol","checksum","integrity"],"backgroundTag":"protocol-stream-corrupted","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}