Skip to content

Fix SevenZip::reset() to also reset formatFlags#47

Merged
insign merged 1 commit into
mainfrom
fix-reset-format-flags-2340808107410579736
May 8, 2026
Merged

Fix SevenZip::reset() to also reset formatFlags#47
insign merged 1 commit into
mainfrom
fix-reset-format-flags-2340808107410579736

Conversation

@insign
Copy link
Copy Markdown
Contributor

@insign insign commented May 5, 2026

This PR addresses a bug where SevenZip::reset() failed to reset $this->formatFlags.

When reset() was called, it correctly cleared $this->format (so that getFormat() would return the default '7z'), but left $this->formatFlags unchanged. As a result, subsequent operations would attempt to build a '7z' archive but use compression flags from the previously configured format (e.g., -tzip), causing 7-Zip executions to fail with invalid archive errors.

The fix calls setFormatFlags() inside the reset() method to ensure flags correctly align with the reset format. A test case was also added to ensure this behavior is verified in the suite. No .md files were changed as none were impacted by this fix. All pre-commit checks pass and no dummy test files are leaked.


PR created automatically by Jules for task 2340808107410579736 started by @insign

When `reset()` was called, it cleared `$this->format` (causing `getFormat()` to return the default `7z`), but failed to reset `$this->formatFlags`. This resulted in subsequent operations attempting to build `7z` archives using flags from the previously set format (e.g., `-tzip`), causing failures and invalid archives. This commit fixes the bug by calling `setFormatFlags()` inside `reset()` and adds a test for it.

Co-authored-by: insign <1113045+insign@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@insign insign merged commit 458339d into main May 8, 2026
9 checks passed
@insign insign deleted the fix-reset-format-flags-2340808107410579736 branch May 8, 2026 18:54
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.

1 participant