amplify-js icon indicating copy to clipboard operation
amplify-js copied to clipboard

chore: Upgrade to uuid 8.3.2

Open MatrixFrog opened this issue 3 years ago • 8 comments

Description of changes

Upgrade uuid to avoid some annoying install-time warnings about potential risks in older uuid's (#8464). Trying this again after previous attempt was rolled back (#9159)

Issue #, if available

https://github.com/aws-amplify/amplify-js/issues/8464

Description of how you validated changes

ran tests on CI

Checklist

  • [x] PR description included
  • [x] yarn test passes

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

MatrixFrog avatar Dec 01 '21 04:12 MatrixFrog

@MatrixFrog we had to revert ur earlier upgrades of uuid because of failure in RN. If you could test it out in RN and let us know how it goes, we could merge this. Or we will investigate this issue in an upcoming cycle and post on how the investigation goes.

ashika01 avatar Dec 07 '21 16:12 ashika01

RN meaning react-native? Is there a little sample react-native project I can test on or something?

MatrixFrog avatar Dec 10 '21 01:12 MatrixFrog

@MatrixFrog I will get back on this today. there seems to be an issue in react native in datastore usage in specific. Let me get more detail and ping here.

ashika01 avatar Jan 04 '22 18:01 ashika01

I think I found the error you're talking about:

Error: crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported

Will try to look into it further tomorrow.

MatrixFrog avatar Jan 08 '22 06:01 MatrixFrog

so i guess the easiest might be to just tell users they need to add import 'react-native-get-random-values'; before importing the datastore package, which presumably would be a breaking change. kind of annoying react-native doesn't just ship with an implementation of crypto that matches other environments :(

MatrixFrog avatar Jan 09 '22 02:01 MatrixFrog

This is the same approach taken here: https://github.com/aws/aws-sdk-js-v3/blob/main/README.md#getting-started what do you think?

MatrixFrog avatar Jan 09 '22 20:01 MatrixFrog

Is there a way to just to make the polyfill a peerDependency and include it if crypto.getRandomValues() doesn't exist? This way it is transparent to developers. It might not even be a breaking change? At least it's not clear why it would be...

GeorgeBellTMH avatar Jul 30 '22 18:07 GeorgeBellTMH

If it is a breaking change, is there a way to put it behind a feature or version flag...so that new projects, and projects not using datastore can move forward...

GeorgeBellTMH avatar Jul 30 '22 18:07 GeorgeBellTMH

Any plan to resolve conflicts and release the fix?

mcqj avatar Sep 28 '22 13:09 mcqj

Might be easier to switch to a different uuid generator...react-native-uuid or something?

GeorgeBellTMH avatar Sep 28 '22 14:09 GeorgeBellTMH

I'm happy to resolve conflicts if it will help get this merged!

MatrixFrog avatar Sep 29 '22 21:09 MatrixFrog

Hi @MatrixFrog - this change would break existing React Native customers. So we will be holding off on merging it until our next major version bump.

abdallahshaban557 avatar Feb 08 '23 20:02 abdallahshaban557

so i guess the easiest might be to just tell users they need to add import 'react-native-get-random-values'; before importing the datastore package

is there some kind of release notes file I should add this to?

MatrixFrog avatar Feb 08 '23 21:02 MatrixFrog

@MatrixFrog - this would actually make more sense to add to our documentation on docs.amplify.aws. We can handle that once the PR is ready to be merged as part of our next major version bump. We do not have an exact ETA on it, but we are tracking this PR as a part of that effort.

abdallahshaban557 avatar Feb 09 '23 01:02 abdallahshaban557

@MatrixFrog, this upgrade to the uuid version is now out in v6 of Amplify. Can you update and validate if the concerns in this PR are addressed?

cwomack avatar Jan 09 '24 21:01 cwomack

looks like all the places that a package depends on uuid are now at ^9.0.0

thanks!

MatrixFrog avatar Jan 09 '24 22:01 MatrixFrog