atharvalade opened a new pull request, #3166:
URL: https://github.com/apache/iggy/pull/3166

   ## Which issue does this PR close?
   
   Closes #3129
   
   ## Rationale
   
   Library code should never panic on bad server data — a truncated or corrupt 
S2-compressed message currently crashes the entire Go client process.
   
   ## What changed?
   
   `DeserializeFetchMessagesResponse` called `panic()` when `s2.Decode` failed 
on a malformed compressed payload. Callers had no way to recover.
   
   Replaced `panic(...)` with `return nil, fmt.Errorf(...)` so the error 
propagates through the existing `error` return value. Added unit tests covering 
the malformed S2 path, the no-compression path, and the empty-payload path.
   
   ## Local Execution
   
   - Passed
   - Pre-commit hooks ran (license-headers, trailing-whitespace, 
trailing-newline all clean on changed files)
   
   ## AI Usage
   
   1. Opus 4.6
   2. Guided the fix and test scaffolding
   3. Ran `go test`, `go vet`, and CI lint scripts locally; all pass
   4. Yes, all code can be explained


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to