Skip to content

Fix the MD5 computation in the src/core/writer.js file #19693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Mar 20, 2025

Currently the MD5 computation doesn't actually work (at all?), since we're invoking the calculateMD5 function without providing all of the necessary parameters and the PDF-data thus isn't taken into account.

Fixing this caused unit-tests to fail, which isn't that surprising since the current date/time is used in the MD5 computation, and we thus utilize Jasmine to work-around that.

@Snuffleupagus Snuffleupagus added core release-blocker Blocker for the upcoming release labels Mar 20, 2025
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/be83f9ee48219b6/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/40f43de3848eac2/output.txt

@nicolo-ribaudo
Copy link
Contributor

nicolo-ribaudo commented Mar 20, 2025

Jasmine has some APIs that allow controlling time when testing: https://jasmine.github.io/api/5.6/Clock.

I don't know if mockDate also mocks Date.now(), but it might be worth trying.

Currently the MD5 computation doesn't actually work (at all?), since we're invoking the `calculateMD5` function without providing all of the necessary parameters and the PDF-data thus isn't taken into account.

Fixing this caused unit-tests to fail, which isn't that surprising since the current date/time is used in the MD5 computation, and we thus utilize Jasmine to work-around that.
@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/be83f9ee48219b6/output.txt

Total script time: 30.24 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: Passed

@Snuffleupagus
Copy link
Collaborator Author

/botio unittest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/0ab00de7f063ecb/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/0ab00de7f063ecb/output.txt

Total script time: 2.37 mins

  • Unit Tests: Passed

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

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

What a stupid bug...
Thank you for fixing it.

@Snuffleupagus Snuffleupagus merged commit a229914 into mozilla:master Mar 20, 2025
9 checks passed
@Snuffleupagus Snuffleupagus deleted the writer-fix-md5 branch March 20, 2025 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core release-blocker Blocker for the upcoming release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants