Skip to content

Restore WriteToDirectoryAsync progress callbacks for solid 7z archives - #1340

Merged
adamhathcock merged 5 commits into
masterfrom
copilot/fix-7zip-progress-reporting
May 29, 2026
Merged

adamhathcock merged 5 commits into
masterfrom
copilot/fix-7zip-progress-reporting

Conversation

Copilot AI commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

ArchiveFactory.OpenAsyncArchive(...).WriteToDirectoryAsync(..., progress: ...) did not emit progress for solid 7z extraction paths, while non-solid paths (e.g. zip) did. This change aligns async solid/7z behavior with existing progress-reporting semantics.

  • Root cause

    • The solid/7z branch delegated to IAsyncReader.WriteAllToDirectoryAsync, which extracts entries but has no progress callback surface.
  • Implementation

    • Updated IAsyncArchiveExtensions.WriteToDirectoryAsync solid/7z branch to iterate reader entries explicitly and report progress after each non-directory entry.
    • Progress now uses the same ProgressReport(entryKey, bytesRead, totalBytes) model as the non-solid async path.
  • Regression coverage

    • Added SevenZipArchive_Solid_WriteToDirectoryAsync_WithProgress in async 7z tests.
    • Test opens 7Zip.solid.7z via ArchiveFactory.OpenAsyncArchive, extracts with progress, and asserts callbacks are emitted.
while (await reader.MoveToNextEntryAsync(cancellationToken).ConfigureAwait(false))
{
    await reader.WriteEntryToDirectoryAsync(destinationDirectory, options, cancellationToken);

    if (!reader.Entry.IsDirectory)
    {
        bytesRead += reader.Entry.Size;
        progress?.Report(new ProgressReport(reader.Entry.Key ?? string.Empty, bytesRead, totalBytes));
    }
}

Copilot AI changed the title [WIP] Fix WriteToDirectoryAsync progress reporting for solid 7zip archives Restore WriteToDirectoryAsync progress callbacks for solid 7z archives May 29, 2026
Copilot AI requested a review from adamhathcock May 29, 2026 08:05
@adamhathcock
adamhathcock marked this pull request as ready for review May 29, 2026 08:06
Copilot AI review requested due to automatic review settings May 29, 2026 08:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Restores progress callback emission for the solid/7z branch of IAsyncArchive.WriteToDirectoryAsync, which previously delegated to IAsyncReader.WriteAllToDirectoryAsync (no progress surface) and silently dropped reports. The solid path now iterates entries explicitly and reports progress using the same ProgressReport(key, bytesRead, totalBytes) model as the non-solid path.

Changes:

  • In IAsyncArchiveExtensions.WriteToDirectoryAsync, replace WriteAllToDirectoryAsync with an explicit MoveToNextEntryAsync/WriteEntryToDirectoryAsync loop that emits progress per non-directory entry.
  • Add regression test SevenZipArchive_Solid_WriteToDirectoryAsync_WithProgress.
  • Lock-file changes that downgrade Microsoft.NET.ILLink.Tasks/Microsoft.DotNet.ILCompiler and drop the net10.0/osx-arm64 runtime section (appears unrelated to PR purpose).

Reviewed changes

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

File Description
src/SharpCompress/Archives/IAsyncArchiveExtensions.cs Replace solid-branch WriteAllToDirectoryAsync call with an explicit entry loop that emits ProgressReport per non-directory entry.
tests/SharpCompress.Test/SevenZip/SevenZipArchiveAsyncTests.cs New test verifying progress callbacks are emitted when extracting a solid 7z archive via WriteToDirectoryAsync.
src/SharpCompress/packages.lock.json Downgrades Microsoft.NET.ILLink.Tasks for net10.0 and net8.0; appears unrelated to PR purpose.
tests/SharpCompress.AotSmoke/packages.lock.json Downgrades ILCompiler/ILLink.Tasks and removes the net10.0/osx-arm64 runtime section; appears unrelated.

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

Comment thread src/SharpCompress/packages.lock.json Resolved
Copilot AI requested a review from adamhathcock May 29, 2026 08:14
Copilot AI review requested due to automatic review settings May 29, 2026 08:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

@adamhathcock
adamhathcock merged commit eb5efc2 into master May 29, 2026
7 checks passed
@adamhathcock
adamhathcock deleted the copilot/fix-7zip-progress-reporting branch May 29, 2026 08:48
github-actions Bot pushed a commit to Stella-sea/ryujinx-admin that referenced this pull request May 31, 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.1` → `0.49.1` | ![age](https://developer.mend.io/api/mc/badges/age/nuget/SharpCompress/0.49.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/SharpCompress/0.48.1/0.49.1?slim=true) |

---

### Release Notes

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

### [`v0.49.1`](https://github.com/adamhathcock/sharpcompress/releases/tag/0.49.1): - More fixes

[Compare Source](adamhathcock/sharpcompress@0.49.0...0.49.1)

#### What's Changed

- Close writable entry streams during async archive disposal by [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;1338](adamhathcock/sharpcompress#1338)
- Restore `WriteToDirectoryAsync` progress callbacks for solid 7z archives by [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;1340](adamhathcock/sharpcompress#1340)
- Try to fix global.json to avoid churn in locks by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1341](adamhathcock/sharpcompress#1341)
- Fix tar archive enumeration after fully reading entry streams by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1342](adamhathcock/sharpcompress#1342)

**Full Changelog**: <adamhathcock/sharpcompress@0.49.0...0.49.1>

### [`v0.49.0`](https://github.com/adamhathcock/sharpcompress/releases/tag/0.49.0): - Write Async fixes and more.

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

This should contain a lot of write async fixes and some breaking API changes that fix previous broke `net48` usage

#### What's Changed

- Rename IWriteableArchiveFactory.cs to IWritableArchiveFactory.cs by [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;1244](adamhathcock/sharpcompress#1244)
- Some API clean up from GPT 5.4 by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1243](adamhathcock/sharpcompress#1243)
- Release to master by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1267](adamhathcock/sharpcompress#1267)
- Fix three BLAKE2sp correctness bugs and eliminate allocations in hot path by [@&#8203;coderb](https://github.com/coderb) in [#&#8203;1266](adamhathcock/sharpcompress#1266)
- Corrected async examples. by [@&#8203;dlemstra](https://github.com/dlemstra) in [#&#8203;1277](adamhathcock/sharpcompress#1277)
- Fix setting invalid access time fails extraction by [@&#8203;aromaa](https://github.com/aromaa) in [#&#8203;1279](adamhathcock/sharpcompress#1279)
- Fix incorrect code examples in docs for sync/async usage by [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;1280](adamhathcock/sharpcompress#1280)
- Replace APPNOTE.TXT contents with reference link note by [@&#8203;puk06](https://github.com/puk06) in [#&#8203;1286](adamhathcock/sharpcompress#1286)
- Release to Master by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1274](adamhathcock/sharpcompress#1274)
- update docs for tar gap analysis and XZ usage by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1288](adamhathcock/sharpcompress#1288)
- Add a PooledMemoryStream to avoid allocating by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1275](adamhathcock/sharpcompress#1275)
- fix: Change LeaveStreamOpen default from true to false by [@&#8203;puk06](https://github.com/puk06) in [#&#8203;1293](adamhathcock/sharpcompress#1293)
- Fix usage of ReaderOptions and pre-defined values by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1295](adamhathcock/sharpcompress#1295)
- Enforce seekable, readable and writable on streams by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1297](adamhathcock/sharpcompress#1297)
- Add ArchiveInformation record for consolidated archive detection and capability inspection by [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;1299](adamhathcock/sharpcompress#1299)
- merge release to master by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1314](adamhathcock/sharpcompress#1314)
- Some clean up and test clean up by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1321](adamhathcock/sharpcompress#1321)
- Finish Write Async by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1323](adamhathcock/sharpcompress#1323)
- More complete Tar implementation: USTAR, PAX, etc. by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1289](adamhathcock/sharpcompress#1289)
- Add Polysharp and adjustments that do not break legacy frameworks by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1330](adamhathcock/sharpcompress#1330)
- Fix null `IVolume.FileName` for single-volume file-based archives by [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;1333](adamhathcock/sharpcompress#1333)
- Add skills by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1332](adamhathcock/sharpcompress#1332)
- add AOT smoke and missing tests by [@&#8203;adamhathcock](https://github.com/adamhathcock) in [#&#8203;1334](adamhathcock/sharpcompress#1334)

#### New Contributors

- [@&#8203;dlemstra](https://github.com/dlemstra) made their first contribution in [#&#8203;1277](adamhathcock/sharpcompress#1277)
- [@&#8203;aromaa](https://github.com/aromaa) made their first contribution in [#&#8203;1279](adamhathcock/sharpcompress#1279)
- [@&#8203;puk06](https://github.com/puk06) made their first contribution in [#&#8203;1286](adamhathcock/sharpcompress#1286)

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

</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/123
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.

No WriteToDirectoryAsync progress reporting for solid 7zip archives

3 participants