Repository navigation
fix: Change LeaveStreamOpen default from true to false - #1293
Merged
adamhathcock merged 9 commits intoApr 21, 2026
Merged
Conversation
As of v0.21, the library is documented to close wrapped streams by default. However, the ReaderOptions.LeaveStreamOpen property defaulted to true, which contradicted the documented behavior and caused file locks when deleting archives after extraction. Changes: - Set LeaveStreamOpen = false as the default (consistent with v0.21 design) - Updated ReaderOptions.cs with comprehensive documentation explaining: * File-based vs caller-provided stream handling * When to use LeaveStreamOpen = true * Usage examples for both scenarios - Updated AGENTS.md Stream Handling Rules section with: * Clear explanation of default disposal behavior * Overload differences (file-based vs stream-based) * Guidance on using ForExternalStream preset This ensures the implementation matches the documented behavior and prevents unexpected file locking issues during archive deletion. Fixes: File deletion failures after archive extraction
puk06
marked this pull request as draft
April 20, 2026 13:52
adamhathcock
marked this pull request as ready for review
April 20, 2026 13:59
adamhathcock
marked this pull request as draft
April 20, 2026 13:59
Contributor
Author
|
Please note that while this change aligns with the documented specification, it is a breaking change that may affect existing code. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This was referenced Aug 5, 2026
This was referenced Sep 1, 2026
This was referenced Oct 17, 2026
This was referenced Oct 26, 2026
This was referenced Nov 5, 2026
This was referenced Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As of v0.21, the library is documented to close wrapped streams by default. However, the ReaderOptions.LeaveStreamOpen property defaulted to true, which contradicted the documented behavior and caused file locks when deleting archives after extraction.
Changes:
This ensures the implementation matches the documented behavior and prevents unexpected file locking issues during archive deletion.
Fixes: File deletion failures after archive extraction
Please note that while this change aligns with the documented specification, it is a breaking change that may affect existing code.
The removal of the explicit
LeaveStreamOpen=falseoverride inZipArchivewas motivated by the fact thatfalseis now the default. However, since other Archive types originally relied on the default value oftrue, existing code that does not explicitly specify ReaderOptions may behave differently than before.Breaking changes of this nature should be documented somewhere. That said, since I'm not familiar enough with where exactly the documentation should be updated, I've opted not to include those changes in this pull request.