Closed agalloch closed 8 months ago
In v1.5.2.3
, zstd decompression frame check is strictly.
https://github.com/SpringMT/zstd-ruby/blob/main/ext/zstdruby/zstdruby.c#L121-L124
Previously using ZSTD_getDecompressedSize
when check decompression string, but this method is obsolete.
So, v1.5.2.3 zstd-ruby gem uses ZSTD_getFrameContentSize
.
https://raw.githack.com/facebook/zstd/release/doc/zstd_manual.html#Chapter3
In ZSTD_getFrameContentSize
, an empty string with decompression is invalid, so in the spec, an empty string decompression should have been treated as an error.
The example from the zstd sample.
https://github.com/facebook/zstd/blob/dev/examples/simple_decompression.c#L27
It is not regression but breaking backward compatibility.
Is there any inconvenience?
Hello @SpringMT, I'm not sure whether zstd-ruby
gem uses semantic versioning but if it does, it's unusual to introduce backward incompatibility with a patch update such as 1.5.2.2 -> 1.5.2.3
.
Do you recommend I use Zstd::StreamingDecompress
when the source could be a blank string? 🙂
I'm considering again whether it is correct that Zstd::StreamingDecompress
and Zstd.decompress
is different behavior.
First of all, I added the breaking change about an empty string decompress to the release note. https://github.com/SpringMT/zstd-ruby/releases/tag/v1.5.2.3
Hello, thank you for maintaining this awesome gem! 👏
When upgrading
zstd-ruby
from 1.5.2.2 to 1.5.2.3 I've encountered the following difference indecompress
behaviour:vs.
Since it's the same upstream version of
zstd
library (https://github.com/facebook/zstd/releases/tag/v1.5.2), this seems like a regression in the gem.Am I missing something?