Skip to content

Remove NRE workaround and implement progress completion via event handlers#94

Open
kborowinski wants to merge 1 commit intothoemmi:masterfrom
kborowinski:master
Open

Remove NRE workaround and implement progress completion via event handlers#94
kborowinski wants to merge 1 commit intothoemmi:masterfrom
kborowinski:master

Conversation

@kborowinski
Copy link
Contributor

@kborowinski kborowinski commented Feb 3, 2025

@thoemmi

  1. Use ExtractionFinished and CompressionFinished event handlers to properly complete the progress bar instance
  2. Remove the workaround for NullReferenceException on PS 7.4.0 when extracting multiple 7zip archives simultaneously  #88:
    • The cause of this issue has been identified and a PR is in the approval process. The issue was caused by race conditions where multiple threads attempted to write to the console simultaneously, leading to NullReferenceExceptions. The PR introduces additional locking mechanisms to prevent such occurrences and ensure thread-safe console access.

@thoemmi thoemmi requested a review from Copilot March 2, 2025 16:29
Copy link
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.

PR Overview

This PR removes the NullReferenceException workaround and implements progress completion via event handlers for both extraction and compression operations.

  • Added ExtractionFinished and CompressionFinished event handlers to update and complete the progress bar
  • Removed the try-catch block in ThreadedCmdlet.cs that handled the obsolete workaround for NREs

Reviewed Changes

File Description
7Zip4Powershell/Expand7Zip.cs Added ExtractionFinished event handler to mark extraction progress as complete.
7Zip4Powershell/Compress7Zip.cs Added CompressionFinished event handler to mark compression progress as complete.
7Zip4Powershell/ThreadedCmdlet.cs Removed obsolete try-catch block for NullReferenceException workaround.

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

@kborowinski
Copy link
Contributor Author

kborowinski commented Apr 4, 2025

@thoemmi Please. do not merge until this PR is approved by PowerShell team

@thoemmi
Copy link
Owner

thoemmi commented Apr 6, 2025

@kborowinski that's why I have not merged it yet ;)

@kborowinski
Copy link
Contributor Author

@thoemmi The PR got merged on 7.6 branch but unfortunately will not be backported to 7.5 and 7.4. Since 7.6 will be LTS you might consider to merge this PR on 7.6 GA

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.

3 participants