You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Breaking change]: Validate CompressionLevel for BrotliStream #25665
🏁 Release: .NET 7Work items for the .NET 7 releasebinary incompatibleExisting binaries may encounter a breaking change in behavior.breaking-changeIndicates a .NET Core breaking changesource incompatibleSource code may encounter a breaking change in behavior when targeting the new version.
The change validates that the CompressionLevel argument of the System.IO.Compression.BrotliStream constructors is a defined value of the enum: Optimal, Fastest, NoCompression or SmallestSize.
Previously any underlying value from 0 to 11 would be valid and passed on as the level to Brotli, unless it's mapped to any of the CompressionLevel enum values.
Version
.NET 7 Preview 1
Previous behavior
Passing any value between 0 and 11 to the CompressionLevel parameter BrotliStream would be valid.
The value would either map to the one of the enum's defined values or passed as is to the underlying Brotli implementation.
New behavior
Only Optimal, Fastest, NoCompression or SmallestSize are valid values for the CompressionLevel parameter.
Type of breaking change
Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load/execute or different run-time behavior.
Source incompatible: Source code may encounter a breaking change in behavior when targeting the new runtime/component/SDK, such as compile errors or different run-time behavior.
Reason for change
Being able to pass arbitrary values which are not defined by the CompressionLevel enum is unexpected and undocumented with a probability for mistakes.
Recommended action
Pass in only one of the valid values for CompressionLevel
Feature area
Core .NET libraries
Affected APIs
All System.IO.Compression.BrotliStream constructors that accept CompressionLevel
Thank you @i3arnon for adding the breaking change doc!
The linked PR dotnet/runtime#57561will hopefully be merged this week got merged. I edited the "Version" section of the description to indicate it would go to Preview 1. @gewarren please let me know if the value should be different.
🏁 Release: .NET 7Work items for the .NET 7 releasebinary incompatibleExisting binaries may encounter a breaking change in behavior.breaking-changeIndicates a .NET Core breaking changesource incompatibleSource code may encounter a breaking change in behavior when targeting the new version.
Activity
i3arnon commentedon Aug 17, 2021
The relevant PR: dotnet/runtime#57561
[-][Breaking change]: [/-][+][Breaking change]: Validate CompressionLevel for BrotliStream[/+]carlossanlop commentedon Nov 1, 2021
Thank you @i3arnon for adding the breaking change doc!
The linked PR dotnet/runtime#57561
will hopefully be merged this weekgot merged. I edited the "Version" section of the description to indicate it would go to Preview 1. @gewarren please let me know if the value should be different.