[PR #1081] [MERGED] Fix async LZMA extraction bug for 7Zip archives #1503

Closed
opened 2026-01-29 22:20:53 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/1081
Author: @Copilot
Created: 12/19/2025
Status: Merged
Merged: 12/19/2025
Merged by: @adamhathcock

Base: adam/extract-all-testHead: copilot/sub-pr-1076-again


📝 Commits (10+)

  • d4380b6 Initial plan
  • c082d42 Changes before error encountered
  • 0d487df Add IProgress support for compression operations with tests
  • 0f374b2 Address code review: ProgressReportingStream now throws on writes
  • aa0356d Changes before error encountered
  • 8fc5ca5 Unify progress reporting: remove IExtractionListener and add IProgress support for reading
  • 7af029b Address code review: properly handle zero-sized entries in progress reporting
  • e2df789 Remove IArchiveExtractionListener and add IProgress support to Archive Entry extraction
  • 0fdf9c7 Address code review: Replace dynamic with IArchiveProgressInfo interface
  • 14d432e Pass progress as parameter to WriteTo/WriteToAsync instead of storing on archive

📊 Changes

33 files changed (+1184 additions, -517 deletions)

View changed files

📝 AGENTS.md (+3 -1)
📝 FORMATS.md (+13 -1)
📝 build/Program.cs (+10 -1)
📝 src/SharpCompress/Archives/AbstractArchive.cs (+4 -41)
📝 src/SharpCompress/Archives/IArchive.cs (+0 -6)
📝 src/SharpCompress/Archives/IArchiveEntryExtensions.cs (+66 -30)
src/SharpCompress/Archives/IArchiveExtractionListener.cs (+0 -10)
📝 src/SharpCompress/Archives/Rar/RarArchiveEntry.cs (+4 -4)
📝 src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs (+126 -31)
src/SharpCompress/Common/ArchiveExtractionEventArgs.cs (+0 -10)
src/SharpCompress/Common/CompressedBytesReadEventArgs.cs (+0 -25)
src/SharpCompress/Common/FilePartExtractionBeginEventArgs.cs (+0 -28)
src/SharpCompress/Common/IExtractionListener.cs (+0 -7)
src/SharpCompress/Common/ProgressReport.cs (+43 -0)
src/SharpCompress/Common/ReaderExtractionEventArgs.cs (+0 -17)
📝 src/SharpCompress/Compressors/LZMA/LzmaStream.cs (+26 -10)
📝 src/SharpCompress/Compressors/Rar/MultiVolumeReadOnlyStream.cs (+1 -37)
src/SharpCompress/IO/ListeningStream.cs (+0 -97)
src/SharpCompress/IO/ProgressReportingStream.cs (+160 -0)
📝 src/SharpCompress/Readers/AbstractReader.cs (+42 -52)

...and 13 more files

📄 Description

  • Initial plan
  • Fix the test targets
  • Fix logic to match ExtractAllEntries
  • Code formatting
  • Restore original async test with using statement for reader disposal
  • Add separate ExtractAllEntriesSync test (all 7 tests pass)
  • Investigate async LZMA extraction bug
    • Identified root cause: LZMA decoder async implementation bugs
    • Implemented workaround: Fresh streams + SyncOnlyStream wrapper
    • All 14 tests passing (7 async + 7 sync)
  • Document async extraction behavior and performance implications
  • Clarified SyncOnlyStream is a workaround for LZMA decoder bugs, not state sharing

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/adamhathcock/sharpcompress/pull/1081 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 12/19/2025 **Status:** ✅ Merged **Merged:** 12/19/2025 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `adam/extract-all-test` ← **Head:** `copilot/sub-pr-1076-again` --- ### 📝 Commits (10+) - [`d4380b6`](https://github.com/adamhathcock/sharpcompress/commit/d4380b6bb674120bd57d351ea83ef9cdc2c7ebfe) Initial plan - [`c082d42`](https://github.com/adamhathcock/sharpcompress/commit/c082d4203b46cfd1a70ec4d4fec4d453a650e9e3) Changes before error encountered - [`0d487df`](https://github.com/adamhathcock/sharpcompress/commit/0d487df61be7762abdbcb72ae56cdee8f2ebbf51) Add IProgress support for compression operations with tests - [`0f374b2`](https://github.com/adamhathcock/sharpcompress/commit/0f374b27cf90e58906329f8c7969edb372a4d243) Address code review: ProgressReportingStream now throws on writes - [`aa0356d`](https://github.com/adamhathcock/sharpcompress/commit/aa0356de9f2df0740aa00d49221c3973c9d6b627) Changes before error encountered - [`8fc5ca5`](https://github.com/adamhathcock/sharpcompress/commit/8fc5ca5a71ec5f3ed66ac17116da512e74b39231) Unify progress reporting: remove IExtractionListener and add IProgress support for reading - [`7af029b`](https://github.com/adamhathcock/sharpcompress/commit/7af029b5de8c12a7d7723809525433a8f91658ee) Address code review: properly handle zero-sized entries in progress reporting - [`e2df789`](https://github.com/adamhathcock/sharpcompress/commit/e2df7894f98bff34cd850512b0749d02d1c30677) Remove IArchiveExtractionListener and add IProgress support to Archive Entry extraction - [`0fdf9c7`](https://github.com/adamhathcock/sharpcompress/commit/0fdf9c74a8135bc4681bd75000c392b654810910) Address code review: Replace dynamic with IArchiveProgressInfo interface - [`14d432e`](https://github.com/adamhathcock/sharpcompress/commit/14d432e22ddf56b1fc1b5f1127aa9b445dadef98) Pass progress as parameter to WriteTo/WriteToAsync instead of storing on archive ### 📊 Changes **33 files changed** (+1184 additions, -517 deletions) <details> <summary>View changed files</summary> 📝 `AGENTS.md` (+3 -1) 📝 `FORMATS.md` (+13 -1) 📝 `build/Program.cs` (+10 -1) 📝 `src/SharpCompress/Archives/AbstractArchive.cs` (+4 -41) 📝 `src/SharpCompress/Archives/IArchive.cs` (+0 -6) 📝 `src/SharpCompress/Archives/IArchiveEntryExtensions.cs` (+66 -30) ➖ `src/SharpCompress/Archives/IArchiveExtractionListener.cs` (+0 -10) 📝 `src/SharpCompress/Archives/Rar/RarArchiveEntry.cs` (+4 -4) 📝 `src/SharpCompress/Archives/SevenZip/SevenZipArchive.cs` (+126 -31) ➖ `src/SharpCompress/Common/ArchiveExtractionEventArgs.cs` (+0 -10) ➖ `src/SharpCompress/Common/CompressedBytesReadEventArgs.cs` (+0 -25) ➖ `src/SharpCompress/Common/FilePartExtractionBeginEventArgs.cs` (+0 -28) ➖ `src/SharpCompress/Common/IExtractionListener.cs` (+0 -7) ➕ `src/SharpCompress/Common/ProgressReport.cs` (+43 -0) ➖ `src/SharpCompress/Common/ReaderExtractionEventArgs.cs` (+0 -17) 📝 `src/SharpCompress/Compressors/LZMA/LzmaStream.cs` (+26 -10) 📝 `src/SharpCompress/Compressors/Rar/MultiVolumeReadOnlyStream.cs` (+1 -37) ➖ `src/SharpCompress/IO/ListeningStream.cs` (+0 -97) ➕ `src/SharpCompress/IO/ProgressReportingStream.cs` (+160 -0) 📝 `src/SharpCompress/Readers/AbstractReader.cs` (+42 -52) _...and 13 more files_ </details> ### 📄 Description - [x] Initial plan - [x] Fix the test targets - [x] Fix logic to match ExtractAllEntries - [x] Code formatting - [x] Restore original async test with using statement for reader disposal - [x] Add separate ExtractAllEntriesSync test (all 7 tests pass) - [x] Investigate async LZMA extraction bug - [x] Identified root cause: LZMA decoder async implementation bugs - [x] Implemented workaround: Fresh streams + SyncOnlyStream wrapper - [x] All 14 tests passing (7 async + 7 sync) - [x] Document async extraction behavior and performance implications - [x] Clarified SyncOnlyStream is a workaround for LZMA decoder bugs, not state sharing <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 22:20:53 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1503