Skip to content

fix: estimate progress for solid 7z archives with small data#441

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:release/eaglefrom
LiHua000:release/eagle
Jul 22, 2026
Merged

fix: estimate progress for solid 7z archives with small data#441
deepin-bot[bot] merged 1 commit into
linuxdeepin:release/eaglefrom
LiHua000:release/eagle

Conversation

@LiHua000

Copy link
Copy Markdown
Contributor

When extracting solid 7z archives with small total data (e.g. 601KB compressed, 35702 files at 6 bytes each), p7zip 16.02 reports 0% for all progress updates because the solid block decompresses instantly. The handleProgress function's percentage > 0 check caused all 0% progress lines to be skipped, leaving the progress bar stuck at "Calculating..." until the process finished and jumped to 100%.

Fix: in the percentage == 0 branch of handleProgress, when the progress line contains a filename (detected by \b\b\b\b and - separator), parse the file index from 7z's output format 0% 1233 - filename and estimate progress as
fileIndex * 100 / totalFiles. Uses lastIndexOf('%', count) to locate the correct % associated with the current file entry rather than the initial 0% at line start.

Also includes:

  • handleLongNameExtract: omit file list for bAllExtract to avoid ARG_MAX overflow with archives containing tens of thousands of files
  • startLongNameProcess: check waitForStarted() return value and clean up on failure
  • onLongNameProcessFinished: apply the same bAllExtract file-list omission when transitioning from rename to extract phase

Log: fix progress bar stuck at "Calculating..." for solid 7z archives with small data
Bug: https://pms.uniontech.com/bug-view-370449.html

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @LiHua000, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

When extracting solid 7z archives with small total data (e.g. 601KB
compressed, 35702 files at 6 bytes each), p7zip 16.02 reports 0% for
all progress updates because the solid block decompresses instantly.
The handleProgress function's `percentage > 0` check caused all 0%
progress lines to be skipped, leaving the progress bar stuck at
"Calculating..." until the process finished and jumped to 100%.

Fix: in the `percentage == 0` branch of handleProgress, when the
progress line contains a filename (detected by `\b\b\b\b` and `-`
separator), parse the file index from 7z's output format
`  0% 1233 - filename` and estimate progress as
`fileIndex * 100 / totalFiles`. Uses `lastIndexOf('%', count)` to
locate the correct `%` associated with the current file entry rather
than the initial `0%` at line start.

Also includes:
- handleLongNameExtract: omit file list for bAllExtract to avoid
  ARG_MAX overflow with archives containing tens of thousands of files
- startLongNameProcess: check waitForStarted() return value and clean
  up on failure
- onLongNameProcessFinished: apply the same bAllExtract file-list
  omission when transitioning from rename to extract phase

Log: fix progress bar stuck at "Calculating..." for solid 7z archives with small data
Bug: https://pms.uniontech.com/bug-view-370449.html
@LiHua000 LiHua000 closed this Jul 22, 2026
@LiHua000 LiHua000 reopened this Jul 22, 2026
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: LiHua000, max-lvs

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@LiHua000

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-bot
deepin-bot Bot merged commit 0f75be6 into linuxdeepin:release/eagle Jul 22, 2026
29 of 30 checks passed
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