Skip to content

fix: report download hash mismatch error during file decryption - #49

Merged
patricioxavier8 merged 1 commit into
mainfrom
fix/download-hash-mismatch-check
Oct 9, 2026
Merged

patricioxavier8 merged 1 commit into
mainfrom
fix/download-hash-mismatch-check

Conversation

@patricioxavier8

Copy link
Copy Markdown
Contributor

📝 Overview

In this PR, the inverted boolean condition in NetworkFacade.decryptFile is fixed so that content hash mismatches on downloaded files are correctly reported:

  • Fixed ignoreHashMissmatchCheck != false to ignoreHashMissmatchCheck == false (or !ignoreHashMissmatchCheck).
  • Previously, since ignoreHashMissmatchCheck defaults to false, false != false evaluated to false, causing corrupted or modified files to silently pass verification without throwing an error.
  • Updated testShouldFailIfHashIsNotMatching to explicitly assert the EnrichedError with .HashMissmatch cause (avoiding false positives when no error was thrown).
  • Added testShouldNotFailIfHashIsNotMatchingAndIgnoreFlagIsTrue to verify that ignoreHashMissmatchCheck: true correctly bypasses the check when requested.

- Fix inverted boolean check in NetworkFacade.decryptFile that prevented hash mismatches from ever being reported
- Update testShouldFailIfHashIsNotMatching to assert EnrichedError with HashMissmatch cause
- Add testShouldNotFailIfHashIsNotMatchingAndIgnoreFlagIsTrue to verify ignoreHashMissmatchCheck flag
@patricioxavier8
patricioxavier8 requested a review from xabg2 as a code owner October 7, 2026 03:02
@patricioxavier8
patricioxavier8 requested review from sg-gs and removed request for xabg2 October 7, 2026 03:02
@patricioxavier8 patricioxavier8 self-assigned this Oct 7, 2026
@patricioxavier8
patricioxavier8 merged commit a2d2e0c into main Oct 9, 2026
1 check passed
@patricioxavier8
patricioxavier8 deleted the fix/download-hash-mismatch-check branch October 9, 2026 00:06
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