fix: 6 bugs (timeline path value, seer SSE cursor, erasure checksum, subtle compare, build status code, dead WorkerName branch)
Some checks failed
Test / test (push) Has been cancelled

This commit is contained in:
drjones
2026-07-05 07:06:59 +00:00
parent 3678b199d0
commit f923b1ef54
6 changed files with 61 additions and 16 deletions

View File

@@ -176,12 +176,12 @@ func (s *Service) Reconstruct(ctx context.Context, bundleID string, indices []in
for i := 0; i < bundle.DataShards; i++ {
out = append(out, shards[i]...)
}
// Trim padding — find actual length via checksum match
sum := sha256.Sum256(out)
trimmed := trimNullPadding(out)
sum := sha256.Sum256(trimmed)
if hex.EncodeToString(sum[:]) != bundle.Checksum {
// Return best-effort; caller validates
return nil, fmt.Errorf("reconstructed data checksum mismatch: bundle may be corrupt")
}
return trimNullPadding(out), nil
return trimmed, nil
}
func trimNullPadding(b []byte) []byte {