-
Notifications
You must be signed in to change notification settings - Fork 22
fix(zstd decompression): add correct usage of zstd library #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughSwitches zstd decompression in encoding/codecv7_types.go to use a DecodeAll call with a nil destination and a decoder initialized via zstd.NewReader(nil, zstd.WithDecoderConcurrency(1)). Removes bytes.Reader usage and minor variable pre-declarations. Error and empty-payload checks remain. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant Decompressor as decompressV7Bytes
participant Zstd as zstd.Decoder
Caller->>Decompressor: decompressV7Bytes(compressedBytes)
note over Decompressor: Initialize decoder<br/>zstd.NewReader(nil, WithDecoderConcurrency(1))
Decompressor->>Zstd: DecodeAll(compressedBytes, nil)
Zstd-->>Decompressor: payload or error
alt error or empty payload
Decompressor-->>Caller: return error
else success
Decompressor-->>Caller: return payload
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (5)📓 Common learnings📚 Learning: 2024-10-18T03:40:09.800ZApplied to files:
📚 Learning: 2024-10-16T18:43:44.520ZApplied to files:
📚 Learning: 2024-10-17T07:33:28.436ZApplied to files:
📚 Learning: 2024-10-16T18:17:33.741ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (3)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Purpose or design rationale of this PR
In zstd the usage of stateless mode is described.
In our case we were initializing the reader (ie stateful mode) with a buffer and then using the stateless
DecodeAllmethod.PR title
Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:
Breaking change label
Does this PR have the
breaking-changelabel?Summary by CodeRabbit