Skip to content

Rename to .zim file, after the checksum append#1108

Merged
kelson42 merged 1 commit into
mainfrom
fix-final-file-renaming
Jul 11, 2026
Merged

Rename to .zim file, after the checksum append#1108
kelson42 merged 1 commit into
mainfrom
fix-final-file-renaming

Conversation

@kelson42

@kelson42 kelson42 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #1106
Superseeds #1107

@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.39%. Comparing base (d3f2313) to head (5cd41a5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1108   +/-   ##
=======================================
  Coverage   56.39%   56.39%           
=======================================
  Files         100      100           
  Lines        5050     5050           
  Branches     2241     2241           
=======================================
  Hits         2848     2848           
  Misses        728      728           
  Partials     1474     1474           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI 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.

Pull request overview

This PR adjusts the ZIM creation finalization flow in Creator::finishZimCreation() so the checksum is appended before the temporary output file is renamed to the final .zim filename, aiming to avoid exposing an invalid “final” file name during checksum computation (Fixes #1107).

Changes:

  • Move checksum appending to occur before renaming the temporary file to the final output name.
  • Ensure the final output name is only used once the checksum has been written.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/writer/creator.cpp
Comment on lines +506 to 511
INFO("Adding checksum...");
addChecksum(data->tmpFileName);

TINFO("rename tmpfile to final one.");
DEFAULTFS::rename(data->tmpFileName, data->zimName);
data->tmpFileName.clear();
@kelson42
kelson42 merged commit 4b71621 into main Jul 11, 2026
31 checks passed
@kelson42
kelson42 deleted the fix-final-file-renaming branch July 11, 2026 13:14
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.

Do not create .zim file until ZIM file is fully ready

2 participants