Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Conversation

@LucianBuzzo
Copy link

@LucianBuzzo LucianBuzzo commented Jan 7, 2022

This change updates to the latest version of uuid, to fix an issue with Math.random() (displayed in a warning on install).
Older versions may use Math.random() in certain circumstances, which is known to be problematic.
See https://v8.dev/blog/math-random for details.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run dtslint with success and extended the tests and types if necessary.
  • I ran npm run test:unit with success.
  • I ran npm run test:cov and my test cases cover all the lines and branches of the added code.
  • I ran npm run build and tested dist/web3.min.js in a browser.
  • I have tested my code on the live network.
  • I have checked the Deploy Preview and it looks correct.
  • I have updated the CHANGELOG.md file in the root folder.

@LucianBuzzo
Copy link
Author

Because the web3-eth-accounts module uses uuid with the random option, it appears to be unaffected by the issue described in my commit message. However it doesn't hurt to update the dependency and prevent a potentially misleading warning message from appearing.

Copy link
Contributor

@jdevcs jdevcs left a comment

Choose a reason for hiding this comment

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

@LucianBuzzo Thanks for pointing this.

Please could you remove all changes of your PR in

  • dist/web3.min.js
  • dist/web3.min.js.map and
  • packages/web3-eth-accounts/package-lock.json .

"ethereumjs-util": "^7.0.10",
"scrypt-js": "^3.0.1",
"uuid": "3.3.2",
"uuid": "8.3.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

That's a drastic change. Let's hope nothing breaks 🤞

Copy link
Author

Choose a reason for hiding this comment

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

@nazarhussain Are there specific things you are concerned about that we could add test cases for? What do you think the biggest risk factors are?

This change updates to the latest version of uuid, to fix an issue with Math.random() (displayed in a warning on install).
Older versions may use Math.random() in certain circumstances, which is known to be problematic.
See https://v8.dev/blog/math-random for details.
@LucianBuzzo LucianBuzzo force-pushed the lucianbuzzo/update-uuid branch from 9b5c755 to 6ec19d0 Compare January 13, 2022 08:41
@LucianBuzzo
Copy link
Author

@jdevcs Done, btw, should the dist files be generated in an npm prepack stage instead of committed to version control?

@jdevcs jdevcs requested a review from luu-alex January 13, 2022 17:36
@jdevcs
Copy link
Contributor

jdevcs commented Jan 14, 2022

@jdevcs Done, btw, should the dist files be generated in an npm prepack stage instead of committed to version control?

Thanks @LucianBuzzo , We dnt commit dist files in feature, bug fix or lib-update PRs.

@spacesailor24 @luu-alex Review/approval for uuid lib update.

@coveralls
Copy link

coveralls commented Jan 14, 2022

Pull Request Test Coverage Report for Build 3003772251

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 74.504%

Totals Coverage Status
Change from base Build 3001839430: -0.01%
Covered Lines: 3274
Relevant Lines: 4140

💛 - Coveralls

@luu-alex
Copy link
Contributor

luu-alex commented Jan 14, 2022

Hey thank you for this PR :) from what it seems in the codebase we only use uuid once. It does look like the method is affected by the version upgrade but it is not breaking.
Perhaps adding a unit testcase using uuid.v4() with the attribute random as an arg wouldn't hurt. Thoughts?

Also updating the changelog and detailing the change

@mconnelly8 mconnelly8 added the 1.x 1.0 related issues label Mar 1, 2022
@jdevcs
Copy link
Contributor

jdevcs commented Mar 17, 2022

@LucianBuzzo please merge down 1.x branch into your branch and fix merge conflicts. Thanks

@jdevcs jdevcs added the Review Needed Maintainer(s) need to review label May 4, 2022
@github-actions
Copy link

github-actions bot commented Jul 4, 2022

This PR has been automatically marked as stale beacause it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

@github-actions github-actions bot added the Stale Has not received enough activity label Jul 4, 2022
@github-actions github-actions bot closed this Jul 31, 2022
@luu-alex luu-alex reopened this Jul 31, 2022
@github-actions github-actions bot closed this Aug 23, 2022
@luu-alex luu-alex reopened this Aug 23, 2022
@avkos avkos requested review from jdevcs and nazarhussain September 6, 2022 22:27
@github-actions github-actions bot removed the Stale Has not received enough activity label Sep 7, 2022
Copy link
Contributor

@jdevcs jdevcs left a comment

Choose a reason for hiding this comment

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

This change is addressed in #5529 so I am closing this PR.

@jdevcs jdevcs closed this Oct 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

1.x 1.0 related issues Review Needed Maintainer(s) need to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants