[PR #1128] [MERGED] Change interfaces to be consistent for new Async paths (definitely breaks things) #1565

Open
opened 2026-01-29 22:21:09 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/1128
Author: @adamhathcock
Created: 1/12/2026
Status: Merged
Merged: 1/15/2026
Merged by: @adamhathcock

Base: masterHead: adam/async-interface


📝 Commits (10+)

  • 05ebf22 Start using the interface to draw distinction between async and sync
  • c5a6f90 Merge branch 'adam/async' into adam/async-interface
  • c1f8580 Remove unnecessary ValueTask wrappers from async factory methods
  • 0615d17 fix async interfacing for open
  • 38203fb Fix async reader variable types - Remove double await on ReaderFactory.OpenAsync and use IAsyncReader
  • fce4a96 make Writable interfaces for archive
  • 0502ff5 test fixes and fmt
  • d727d76 Merge remote-tracking branch 'origin/master' into adam/async-interface
  • 6d6103a update docs
  • 1b4cedf misc fixes

📊 Changes

137 files changed (+4323 additions, -2443 deletions)

View changed files

📝 .editorconfig (+0 -1)
📝 .gitignore (+2 -2)
📝 AGENTS.md (+0 -1)
📝 Directory.Build.props (+1 -0)
📝 Directory.Packages.props (+1 -0)
📝 SharpCompress.sln (+1 -2)
📝 docs/API.md (+91 -68)
📝 docs/ARCHITECTURE.md (+11 -11)
📝 docs/ENCODING.md (+13 -13)
📝 docs/PERFORMANCE.md (+16 -16)
📝 docs/USAGE.md (+17 -17)
📝 src/SharpCompress/Archives/AbstractArchive.cs (+26 -8)
📝 src/SharpCompress/Archives/AbstractWritableArchive.cs (+5 -4)
📝 src/SharpCompress/Archives/ArchiveFactory.cs (+34 -109)
📝 src/SharpCompress/Archives/AutoArchiveFactory.cs (+12 -11)
src/SharpCompress/Archives/GZip/GZipArchive.Factory.cs (+197 -0)
📝 src/SharpCompress/Archives/GZip/GZipArchive.cs (+18 -217)
📝 src/SharpCompress/Archives/GZip/GZipArchiveEntry.cs (+2 -4)
📝 src/SharpCompress/Archives/IArchive.cs (+6 -1)
📝 src/SharpCompress/Archives/IArchiveExtensions.cs (+1 -10)

...and 80 more files

📄 Description

API thinking here: https://github.com/adamhathcock/sharpcompress/issues/1129

This pull request introduces several improvements and clarifications to the SharpCompress codebase and documentation, focusing on enhancing async support, updating documentation for modern usage, and cleaning up code and configuration files. The most significant changes are grouped and summarized below.

Async API Enhancements and Consistency:

  • Improved async method implementations in AbstractArchive by using explicit async enumerator methods for casting and updating aggregate operations to use their async variants (e.g., AggregateAsync, AllAsync). Also added TotalUncompressedSizeAsync and clarified IsEncryptedAsync return type. [1] [2]
  • Refactored ArchiveFactory async methods to remove unnecessary ConfigureAwait(false), streamline calls, and eliminate redundant XML documentation comments, making the async API more idiomatic and easier to maintain. [1] [2] [3] [4] [5] [6] [7] [8]
  • Updated AbstractWritableArchive to implement the new IWritableAsyncArchive interface and unified interface method implementations under IWritableArchiveCommon, improving consistency for writable archives. [1] [2]

Documentation Updates and Modernization:

  • Overhauled docs/API.md to reflect modern async usage patterns, clarify types (IEntryIArchiveEntry), provide more accurate code samples, and expand on supported compression and archive types. Also updated extraction and writer usage to reflect best practices and new APIs. [1] [2] [3] [4] [5] [6] [7]

Configuration and Project Maintenance:

  • Added Microsoft.NET.ILLink.Task package to central package management and enabled CentralPackageTransitivePinningEnabled in build properties to improve dependency management. [1] [2]
  • Removed the .editorconfig rule that set CS1998 (async method lacks 'await') as an error, likely to reduce noise for intentionally synchronous async methods.
  • Updated the solution file to add .gitignore and remove obsolete documentation files, reflecting a cleanup of project structure.

Minor Documentation and Typo Fixes:

  • Fixed a typo in the property name (TotalUncompressSizeTotalUncompressedSize) for clarity and consistency.
  • Removed an outdated note about multi-framework differences from AGENTS.md.

🔄 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/1128 **Author:** [@adamhathcock](https://github.com/adamhathcock) **Created:** 1/12/2026 **Status:** ✅ Merged **Merged:** 1/15/2026 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `adam/async-interface` --- ### 📝 Commits (10+) - [`05ebf22`](https://github.com/adamhathcock/sharpcompress/commit/05ebf2200912231e4fbc5b464e6b8f6a4d2f84f2) Start using the interface to draw distinction between async and sync - [`c5a6f90`](https://github.com/adamhathcock/sharpcompress/commit/c5a6f900df6cca7ccc989fab9aa4acbdc532fd4a) Merge branch 'adam/async' into adam/async-interface - [`c1f8580`](https://github.com/adamhathcock/sharpcompress/commit/c1f8580d89861d496523bded13f0853bf3a20d8e) Remove unnecessary ValueTask wrappers from async factory methods - [`0615d17`](https://github.com/adamhathcock/sharpcompress/commit/0615d17b8b232a0c0e7e8fb14ab45360bae64497) fix async interfacing for open - [`38203fb`](https://github.com/adamhathcock/sharpcompress/commit/38203fb950fbd35fca55a512d0f040e3ee3e5ca0) Fix async reader variable types - Remove double await on ReaderFactory.OpenAsync and use IAsyncReader - [`fce4a96`](https://github.com/adamhathcock/sharpcompress/commit/fce4a96718f4cf5295c78e1c75645eb3f9b59ab0) make Writable interfaces for archive - [`0502ff5`](https://github.com/adamhathcock/sharpcompress/commit/0502ff545ed5bd4c5c1f937b6bdb8ad6ca14dd52) test fixes and fmt - [`d727d76`](https://github.com/adamhathcock/sharpcompress/commit/d727d76299a8584478eca6f7e9bbf09d41c4b0ea) Merge remote-tracking branch 'origin/master' into adam/async-interface - [`6d6103a`](https://github.com/adamhathcock/sharpcompress/commit/6d6103afd6a3f7868002e4e7c66a20af7cda8d6f) update docs - [`1b4cedf`](https://github.com/adamhathcock/sharpcompress/commit/1b4cedfa13188fcd7896b1a03fc1902d3907cfb3) misc fixes ### 📊 Changes **137 files changed** (+4323 additions, -2443 deletions) <details> <summary>View changed files</summary> 📝 `.editorconfig` (+0 -1) 📝 `.gitignore` (+2 -2) 📝 `AGENTS.md` (+0 -1) 📝 `Directory.Build.props` (+1 -0) 📝 `Directory.Packages.props` (+1 -0) 📝 `SharpCompress.sln` (+1 -2) 📝 `docs/API.md` (+91 -68) 📝 `docs/ARCHITECTURE.md` (+11 -11) 📝 `docs/ENCODING.md` (+13 -13) 📝 `docs/PERFORMANCE.md` (+16 -16) 📝 `docs/USAGE.md` (+17 -17) 📝 `src/SharpCompress/Archives/AbstractArchive.cs` (+26 -8) 📝 `src/SharpCompress/Archives/AbstractWritableArchive.cs` (+5 -4) 📝 `src/SharpCompress/Archives/ArchiveFactory.cs` (+34 -109) 📝 `src/SharpCompress/Archives/AutoArchiveFactory.cs` (+12 -11) ➕ `src/SharpCompress/Archives/GZip/GZipArchive.Factory.cs` (+197 -0) 📝 `src/SharpCompress/Archives/GZip/GZipArchive.cs` (+18 -217) 📝 `src/SharpCompress/Archives/GZip/GZipArchiveEntry.cs` (+2 -4) 📝 `src/SharpCompress/Archives/IArchive.cs` (+6 -1) 📝 `src/SharpCompress/Archives/IArchiveExtensions.cs` (+1 -10) _...and 80 more files_ </details> ### 📄 Description API thinking here: https://github.com/adamhathcock/sharpcompress/issues/1129 This pull request introduces several improvements and clarifications to the SharpCompress codebase and documentation, focusing on enhancing async support, updating documentation for modern usage, and cleaning up code and configuration files. The most significant changes are grouped and summarized below. **Async API Enhancements and Consistency:** * Improved async method implementations in `AbstractArchive` by using explicit async enumerator methods for casting and updating aggregate operations to use their async variants (e.g., `AggregateAsync`, `AllAsync`). Also added `TotalUncompressedSizeAsync` and clarified `IsEncryptedAsync` return type. [[1]](diffhunk://#diff-628683fbef185403c5464b90bb2562672e3d38873b30b0d66c1fc7a435332426L190-R209) [[2]](diffhunk://#diff-628683fbef185403c5464b90bb2562672e3d38873b30b0d66c1fc7a435332426L212-R237) * Refactored `ArchiveFactory` async methods to remove unnecessary `ConfigureAwait(false)`, streamline calls, and eliminate redundant XML documentation comments, making the async API more idiomatic and easier to maintain. [[1]](diffhunk://#diff-22b8bc5a3d713f2404d058a5fddfba4cec7f175d67a00be88fe4f96da36f7d18L16-L35) [[2]](diffhunk://#diff-22b8bc5a3d713f2404d058a5fddfba4cec7f175d67a00be88fe4f96da36f7d18L44-R32) [[3]](diffhunk://#diff-22b8bc5a3d713f2404d058a5fddfba4cec7f175d67a00be88fe4f96da36f7d18L65-L81) [[4]](diffhunk://#diff-22b8bc5a3d713f2404d058a5fddfba4cec7f175d67a00be88fe4f96da36f7d18L92-L109) [[5]](diffhunk://#diff-22b8bc5a3d713f2404d058a5fddfba4cec7f175d67a00be88fe4f96da36f7d18L118-L127) [[6]](diffhunk://#diff-22b8bc5a3d713f2404d058a5fddfba4cec7f175d67a00be88fe4f96da36f7d18L149-L154) [[7]](diffhunk://#diff-22b8bc5a3d713f2404d058a5fddfba4cec7f175d67a00be88fe4f96da36f7d18L171-L187) [[8]](diffhunk://#diff-22b8bc5a3d713f2404d058a5fddfba4cec7f175d67a00be88fe4f96da36f7d18L209-L214) * Updated `AbstractWritableArchive` to implement the new `IWritableAsyncArchive` interface and unified interface method implementations under `IWritableArchiveCommon`, improving consistency for writable archives. [[1]](diffhunk://#diff-d9ed0f511148da76d233d734091d18177d526bcb026ed5463061cde0c6d00c7cL15-R16) [[2]](diffhunk://#diff-d9ed0f511148da76d233d734091d18177d526bcb026ed5463061cde0c6d00c7cL86-R100) **Documentation Updates and Modernization:** * Overhauled `docs/API.md` to reflect modern async usage patterns, clarify types (`IEntry` → `IArchiveEntry`), provide more accurate code samples, and expand on supported compression and archive types. Also updated extraction and writer usage to reflect best practices and new APIs. [[1]](diffhunk://#diff-b57590968a12cee85a37c1b91d8cc7092cd8b68e50b242c39a178121db82a797L69-R69) [[2]](diffhunk://#diff-b57590968a12cee85a37c1b91d8cc7092cd8b68e50b242c39a178121db82a797L93-R101) [[3]](diffhunk://#diff-b57590968a12cee85a37c1b91d8cc7092cd8b68e50b242c39a178121db82a797L121-R132) [[4]](diffhunk://#diff-b57590968a12cee85a37c1b91d8cc7092cd8b68e50b242c39a178121db82a797L151-R158) [[5]](diffhunk://#diff-b57590968a12cee85a37c1b91d8cc7092cd8b68e50b242c39a178121db82a797L168-R193) [[6]](diffhunk://#diff-b57590968a12cee85a37c1b91d8cc7092cd8b68e50b242c39a178121db82a797R281-R294) [[7]](diffhunk://#diff-b57590968a12cee85a37c1b91d8cc7092cd8b68e50b242c39a178121db82a797L345-R372) **Configuration and Project Maintenance:** * Added `Microsoft.NET.ILLink.Task` package to central package management and enabled `CentralPackageTransitivePinningEnabled` in build properties to improve dependency management. [[1]](diffhunk://#diff-5baf5f9e448ad54ab25a091adee0da05d4d228481c9200518fcb1b53a65d4156R8) [[2]](diffhunk://#diff-9da24614831c308827a1ae533ffea392c97638c261dd42bd0f5226baa136d16eR15) * Removed the `.editorconfig` rule that set CS1998 (async method lacks 'await') as an error, likely to reduce noise for intentionally synchronous async methods. * Updated the solution file to add `.gitignore` and remove obsolete documentation files, reflecting a cleanup of project structure. **Minor Documentation and Typo Fixes:** * Fixed a typo in the property name (`TotalUncompressSize` → `TotalUncompressedSize`) for clarity and consistency. * Removed an outdated note about multi-framework differences from `AGENTS.md`. --- <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:21:09 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1565