Repository navigation
Conversation
zipstream.readBytes issued a single Read and returned the full buffer even when fewer bytes came back. Files and bytes.Reader always fill the buffer, but network-backed io.ReadSeekers passed to LoadTDF may return short reads, leaving the tail of the manifest or segment zeroed and failing with a segment signature validation error. Use io.ReadFull and keep the existing io.EOF contract for callers. Signed-off-by: sujan kota <sujankota@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Proposed Changes
zipstream.readBytesissued a singleReadand returned the full buffer even when fewer bytes came back.*os.Fileandbytes.Readeralways fill the buffer, but otherio.ReadSeekers passed toLoadTDF(network/blob-backed readers) may legally return short reads. The tail of the manifest or segment was left zeroed, surfacing as a confusing segment signature validation error.io.ReadFull; running out of input early still returnsio.EOF, so callers are unchanged.Checklist
Testing Instructions
cd sdk && go test ./internal/zipstream -run TestReaderShortReads— reads a zip through a reader that returns one byte perRead. Fails before this change, passes after.cd sdk && go test -race ./...passes.golangci-lint run --new-from-rev=maininsdk: 0 new issues.Summary by CodeRabbit