Skip to content

Fix GZip write async#1320

Merged
adamhathcock merged 5 commits into
releasefrom
adam/fix-gzip-save
May 14, 2026
Merged

Fix GZip write async#1320
adamhathcock merged 5 commits into
releasefrom
adam/fix-gzip-save

Conversation

@adamhathcock
Copy link
Copy Markdown
Owner

fixes #1316

same as #1319

This pull request adds asynchronous support for opening GZip archive entry streams and introduces a new async test for GZip archive creation and extraction. The main changes involve implementing an asynchronous version of OpenEntryStream in both the base and writable GZip archive entry classes, updating usings for async functionality, and adding comprehensive tests to validate the new async operations.

Async support for GZip archive entries:

  • Made OpenEntryStreamAsync a virtual method in GZipArchiveEntry, allowing for override and enabling async stream opening for GZip entries.
  • Implemented an override of OpenEntryStreamAsync in GZipWritableArchiveEntry, providing cancellation support and returning a ValueTask<Stream>.
  • Added necessary using statements for System.Threading and System.Threading.Tasks in GZipWritableArchiveEntry.cs to support async methods.

Testing improvements:

  • Added a new async test GZip_Create_New_Async in GZipArchiveAsyncTests.cs to verify asynchronous archive creation, saving, extraction, and file comparison.
  • Updated test file usings to include async-related namespaces.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses async GZip archive writing by enabling OpenEntryStreamAsync to be overridden for writable GZip entries, preventing the NotImplementedException seen during SaveToAsync for newly-created GZip archives. It also adds an async round-trip test covering create → save → open → extract.

Changes:

  • Made GZipArchiveEntry.OpenEntryStreamAsync virtual so writable entries can override async stream opening.
  • Implemented GZipWritableArchiveEntry.OpenEntryStreamAsync to return a stream without touching Parts (which is not implemented for writable entries).
  • Added GZip_Create_New_Async to validate async create/save/open/extract behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/SharpCompress.Test/GZip/GZipArchiveAsyncTests.cs Adds an async GZip create/save/open/extract test (needs fixes for stream disposal / minor cleanup).
src/SharpCompress/Archives/GZip/GZipWritableArchiveEntry.cs Overrides OpenEntryStreamAsync for writable GZip entries to support async save.
src/SharpCompress/Archives/GZip/GZipArchiveEntry.cs Makes OpenEntryStreamAsync virtual to allow writable-entry override.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/SharpCompress.Test/GZip/GZipArchiveAsyncTests.cs Outdated
Comment thread tests/SharpCompress.Test/GZip/GZipArchiveAsyncTests.cs
Comment thread tests/SharpCompress.Test/GZip/GZipArchiveAsyncTests.cs
adamhathcock and others added 4 commits May 14, 2026 08:36
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@adamhathcock adamhathcock merged commit 063e0da into release May 14, 2026
4 checks passed
@adamhathcock adamhathcock deleted the adam/fix-gzip-save branch May 14, 2026 09:18
github-actions Bot pushed a commit to Stella-sea/ryujinx-admin that referenced this pull request May 15, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [SharpCompress](https://github.com/adamhathcock/sharpcompress) | `0.48.0` → `0.48.1` | ![age](https://developer.mend.io/api/mc/badges/age/nuget/SharpCompress/0.48.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/SharpCompress/0.48.0/0.48.1?slim=true) |

---

### Release Notes

<details>
<summary>adamhathcock/sharpcompress (SharpCompress)</summary>

### [`v0.48.1`](https://github.com/adamhathcock/sharpcompress/releases/tag/0.48.1): - GZip writing fix

[Compare Source](adamhathcock/sharpcompress@0.48.0...0.48.1)

#### What's Changed

- release test cleanup by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1322](adamhathcock/sharpcompress#1322)
- Fix GZip write async by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1320](adamhathcock/sharpcompress#1320)

**Full Changelog**: <adamhathcock/sharpcompress@0.48.0...0.48.1>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNzguMCIsInVwZGF0ZWRJblZlciI6IjQzLjE3OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->

Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/97
This was referenced May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants