Skip to content

fix: fixed blockmap updates#93

Merged
Nat3z merged 2 commits intomainfrom
fix/blockmap-updates
Mar 3, 2026
Merged

fix: fixed blockmap updates#93
Nat3z merged 2 commits intomainfrom
fix/blockmap-updates

Conversation

@Nat3z
Copy link
Owner

@Nat3z Nat3z commented Mar 3, 2026

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved reliability of update downloads on Windows systems
    • Added integrity verification for patches to ensure data consistency; mismatched chunks are automatically re-downloaded

@vercel
Copy link

vercel bot commented Mar 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
open-game-installer-web Ready Ready Preview, Comment Mar 3, 2026 4:25am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 3, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The update mechanism in updater/src/main.js has been modified to use absolute file paths on Windows for downloaded archives and adds rigorous per-chunk checksum verification during patch application. These changes ensure consistent artifact storage and validate patch data integrity before writing.

Changes

Cohort / File(s) Summary
Update Path Resolution & Windows Artifact Handling
updater/src/main.js
Modified downloadFullRelease to resolve Windows update archive paths via path.join(__dirname, 'update.zip') instead of relative paths; updated artifact persistence and cleanup operations to use the computed zipPath consistently throughout the flow.
Patch Application Checksum Validation
updater/src/main.js
Enhanced applyBlockmapPatch with per-chunk checksum verification; chunks are only written if their computed checksum matches the expected value, otherwise marked as misses and deferred to re-download.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit's ode to safer updates:
Paths now absolute, archives aligned,
Checksums verify each chunk we find,
No fuzzy patches slip through our care,
Updates hop stronger, beyond compare! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: fixed blockmap updates' is directly related to the main changes, which focus on fixing blockmap patch application with checksum verification, though it could be more specific about what aspect was fixed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/blockmap-updates

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Nat3z
Copy link
Owner Author

Nat3z commented Mar 3, 2026

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 3, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Typecheck Passed - All type checks successful!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@updater/src/main.js`:
- Around line 609-615: The checksum comparison in the block using actualChecksum
and expectedChecksum only normalizes base64, but verifyPatchedArtifact can
supply checksums as base64 or hex, so change the comparison to accept both
encodings: compute the chunk SHA-256 in both base64 (no padding) and hex forms
(lowercase), normalize expectedChecksum by trimming padding and casing, detect
if expectedChecksum is hex (matches /^[0-9a-f]{64}$/i) or base64, or simply
compare against both computed forms, and only treat as a miss if neither match;
update references in this block (actualChecksum, expectedChecksum, createHash)
and ensure the writeSync path remains for successful matches.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ac40dff and 24be8c8.

📒 Files selected for processing (1)
  • updater/src/main.js

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@Nat3z Nat3z merged commit 685190c into main Mar 3, 2026
5 of 6 checks passed
@Nat3z Nat3z deleted the fix/blockmap-updates branch March 3, 2026 04:25
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Typecheck Passed - All type checks successful!

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