Skip to content
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

Null-Safety Support #435

Closed
raywhiteside opened this issue Mar 9, 2021 · 25 comments
Closed

Null-Safety Support #435

raywhiteside opened this issue Mar 9, 2021 · 25 comments
Assignees
Labels
feature-request A request for a new feature or an enhancement to an existing API or category.

Comments

@raywhiteside
Copy link

I assume at some point null safety will be supported. I'd like to track the status and interest here.

@fjnoyp
Copy link
Contributor

fjnoyp commented Mar 10, 2021

Hi @raywhiteside thanks for creating this issue. We don't have any set dates for delivering this, but are actively looking into it. We can update you here.

@fjnoyp fjnoyp self-assigned this Mar 10, 2021
@fjnoyp fjnoyp added the feature-request A request for a new feature or an enhancement to an existing API or category. label Mar 10, 2021
@cto-leaps
Copy link

I'm pretty sure a lot of people are looking to move to null-safety and not having all dependencies supporting it will be an issue soon. Do you guys have any idea of an ETA for this?

@24601
Copy link

24601 commented Mar 27, 2021

I would suggest a heavy priority be put on this. Frankly, a brand-new (as opposed to new rev with old legacy code) project/library like Amplify Flutter NOT supporting this amazes me (to the point of it almost being negligent, given null safety was no surprise, been in plan for quite some time in Flutter, almost as if AWS didn't hire or engage proper Flutter architects to plan this and this is taking the SDK team by surprise despite being a major part of Dart 2 plans and discussed heavily in public all through 2020, with beta versions having it).

Especially considering that null-safe packages are compatible for those not using it, but you're locking out those who are or at least being the delaying dependency for those who otherwise could move (e.g. people not using null-safety could still use amplify-flutter, but people using null safety cannot use amplify-flutter).

The only dependency in our project that doesn't at least have a null-safe version in alpha/preview is Amplify. Somehow, small, understaffed startups, open source projects, etc have managed to pull of what one of the most profitable cloud providers have not (I mean, hell, look at https://pub.dev/packages/amazon_cognito_identity_dart_2/versions/1.0.0-nullsafety.3 - they've already managed to outpace AWS's efforts here in keeping current, why can't AWS?).

In that context, AWS's fumbles in the Amplify SDK and CLI continue to amaze me.

@Ashish-Nanda
Copy link
Contributor

@24601 I understand your frustration, but as you can see above #435 (comment) it is clear that we are actively working on the null safety migrations and acknowledge its importance. We cannot disclose our internal roadmap or dates, but this is one of our top priorities at this time.

Also this is not a surprise for us. The project is new, but was started much before migrations of a lot of community packages began. It was planned to have the migration for all packages (we have 12) after GA, and at the same time to ensure they work together as many are interdependent. Please remember null safety migrations are still happening actively across the Dart/Flutter ecosystem with 775 packages migrating just recently, and different projects will take take time based on size, complexity, dependencies, etc.

While we encourage feedback we request that it is constructive, respectful and adheres to our community guidelines. I assure you we understand the importance of the null safety migration and are actively working on it. We will update this thread as soon as we have a preview version available for customers to try.

@meggamind
Copy link

@Ashish-Nanda Do you need help with this? I would like to make a PR if ya'll need help

@24601
Copy link

24601 commented Mar 30, 2021

@24601 I understand your frustration, but as you can see above #435 (comment) it is clear that we are actively working on the null safety migrations and acknowledge its importance. We cannot disclose our internal roadmap or dates, but this is one of our top priorities at this time.

Also this is not a surprise for us. The project is new, but was started much before migrations of a lot of community packages began. It was planned to have the migration for all packages (we have 12) after GA, and at the same time to ensure they work together as many are interdependent. Please remember null safety migrations are still happening actively across the Dart/Flutter ecosystem with 775 packages migrating just recently, and different projects will take take time based on size, complexity, dependencies, etc.

While we encourage feedback we request that it is constructive, respectful and adheres to our community guidelines. I assure you we understand the importance of the null safety migration and are actively working on it. We will update this thread as soon as we have a preview version available for customers to try.

Thanks for the insight, your comment is not visible in this thread so thanks for sharing the link to the separate issue that is not here. I appreciate being heard and you sharing what is going on behind the scenes that is NOT public information and I look forward to AWS releasing the software.

I reviewed the community guidelines, I did not find anywhere that my comment violated it. If I did, please help me understand so I can avoid doing so in the future, but being frank and upfront doesn't seem to be against the policy. On the other hand, attempting to use community guidelines designed to create a safe space for everyone (which is a VERY good thing!) to silence criticism of AWS as a company's ability to execute as compared to smaller players is actually more harmful to a "safe space" and inclusive community than anything else if you ask me.

I can't seem to find where I ventured into any of the following, but please, feel free to help me understand where I'm going awry here (besides being vocal about a product gap and my expectations of the corporate entity to deliver to paying customers, which, again, I did not detect in the below list of behaviors that are not acceptable):

The use of violent threats, abusive, discriminatory, or derogatory language;
Offensive comments related to gender, gender identity and expression, sexual orientation, disability, mental illness, race, political or religious affiliation;
Posting of sexually explicit or violent content;
The use of sexualized language and unwelcome sexual attention or advances;
Public or private harassment of any kind;
Publishing private information, such as physical or electronic address, without permission;
Other conduct which could reasonably be considered inappropriate in a professional setting;
Advocating for or encouraging any of the above behaviors.

@fjnoyp
Copy link
Contributor

fjnoyp commented Mar 31, 2021

#481 - Null Safety support for Core/Flutter and all Platform Plugin Interfaces
#536 - Null Safety support for Auth
#485 - Null Safety Storage
#484 - Null Safety API
#483 - Null Safety Analytics

@fjnoyp
Copy link
Contributor

fjnoyp commented Apr 22, 2021

Hi everyone, thanks for your patience as we upgrade Amplify Flutter to support Null Safety.

This upgrade is requiring a lot of changes throughout our entire code base so we've created a separate branch here: https://github.com/aws-amplify/amplify-flutter/tree/null-safety-master to aggregate our Null Safety changes.

So far we've upgrade our core and flutter modules as well as all of the interfaces. We'll now be migrating individual module plugins starting with Auth. We'd love to get your feedback during this upgrade. We are migrating Auth now so feel free to take a look at the what's changing here: #536

@maxim-saplin
Copy link

Thanks for the effort taken to migrate to null-safety! Looking forward to pub.dev updaes, will be trying Amplify as soon as null-safe versions are rolled out.

@ErnestDaDev
Copy link

When will these be rolling out?

@yurijdvornyk
Copy link

Hi, any updates on this?

@sima-11
Copy link

sima-11 commented Jun 7, 2021

Understand it may take quite some efforts. But would it be possible to provide a way to generate models with null safety first?
E.g. amplify codegen models --null-safety

@fjnoyp
Copy link
Contributor

fjnoyp commented Jun 11, 2021

@raywhiteside, @sima-11, @yurijdvornyk, @BesavedTech, @maxim-saplin, @cto-leaps

Hi everyone the pre-release version of null safety for Auth, Storage, API, and Analytics is now available. To use it please update your pubspec.yaml to use 0.2.0-nullsafety.0. Do let us know your feedback or if you encounter any issues.

We are currently working on upgrading Datastore to Null Safety and will share updates once that is ready.

@caravanat
Copy link
Contributor

caravanat commented Jun 14, 2021

The 0.2.0-nullsafety.0 branch won't compile for me. I'm having the following error:

e: /Users//Development/flutter/.pub-cache/hosted/pub.dartlang.org/amplify_auth_cognito-0.2.0-nullsafety.0/android/src/main/kotlin/com/amazonaws/amplify/amplify_auth_cognito/types/FlutterFetchCognitoAuthSessionResult.kt: (45, 38): Type mismatch: inferred type is Map<String, Any> but Comparable<{Boolean & String}>? was expected
e: /Users//Development/flutter/.pub-cache/hosted/pub.dartlang.org/amplify_auth_cognito-0.2.0-nullsafety.0/android/src/main/kotlin/com/amazonaws/amplify/amplify_auth_cognito/types/FlutterFetchCognitoAuthSessionResult.kt: (45, 38): Type mismatch: inferred type is Map<String, Any> but Serializable? was expected
e: /Users//Development/flutter/.pub-cache/hosted/pub.dartlang.org/amplify_auth_cognito-0.2.0-nullsafety.0/android/src/main/kotlin/com/amazonaws/amplify/amplify_auth_cognito/types/FlutterFetchCognitoAuthSessionResult.kt: (45, 38): Type mismatch: inferred type is Map<String, Any> but {Comparable<{Boolean & String}>? & java.io.Serializable?} was expected
e: /Users//Development/flutter/.pub-cache/hosted/pub.dartlang.org/amplify_auth_cognito-0.2.0-nullsafety.0/android/src/main/kotlin/com/amazonaws/amplify/amplify_auth_cognito/types/FlutterFetchCognitoAuthSessionResult.kt: (49, 33): Type mismatch: inferred type is Map<String, Any> but Comparable<{Boolean & String}>? was expected
e: /Users//Development/flutter/.pub-cache/hosted/pub.dartlang.org/amplify_auth_cognito-0.2.0-nullsafety.0/android/src/main/kotlin/com/amazonaws/amplify/amplify_auth_cognito/types/FlutterFetchCognitoAuthSessionResult.kt: (49, 33): Type mismatch: inferred type is Map<String, Any> but Serializable? was expected
e: /Users//Development/flutter/.pub-cache/hosted/pub.dartlang.org/amplify_auth_cognito-0.2.0-nullsafety.0/android/src/main/kotlin/com/amazonaws/amplify/amplify_auth_cognito/types/FlutterFetchCognitoAuthSessionResult.kt: (49, 33): Type mismatch: inferred type is Map<String, Any> but {Comparable<{Boolean & String}>? & java.io.Serializable?} was expected

FAILURE: Build failed with an exception.

Looks like the type is missing in the line 35. After changing the code to:

var serializedMap = mutableMapOf<String, Any?>

It worked. I'm gonna do further tests. Thanks, guys!

@jonbhanson
Copy link

Looks like the type is missing in the line 35. After changing the code to:

var serializedMap = mutableMapOf<String, Any?>

It worked. I'm gonna do further tests. Thanks, guys!

Thanks for this solution @caravanat, this worked for me. 👍

@Jordan-Nelson
Copy link
Member

@caravanat and @jonbhanson could you both let me know what version of flutter you are using and what other amplify packages you are using?

@jonbhanson
Copy link

@Jordan-Nelson

Flutter doctor output:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.1, on macOS 11.4 20F71 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.56.2)
[✓] Connected device (3 available)

amplify packages in pubspec.yaml:

  amplify_auth_cognito: ^0.2.0-nullsafety.0
  amplify_flutter: ^0.2.0-nullsafety.0
  amplify_analytics_pinpoint: ^0.2.0-nullsafety.0

@caravanat
Copy link
Contributor

macOS 11.4, Android Studio 4.2.1, flutter 2.2.2.

  amplify_flutter: ^0.2.0-nullsafety.0
  amplify_core: ^0.2.0-nullsafety.0
  amplify_auth_cognito: ^0.2.0-nullsafety.0

@leonardocustodio
Copy link
Contributor

leonardocustodio commented Jun 18, 2021

I'm having the same problem with amplify packages. Can we release a new version with @caravanat fix?
#653

@dnys1
Copy link
Contributor

dnys1 commented Jun 18, 2021

It seems the issue is related to Kotlin itself. The Amplify team currently uses the default version in new Flutter packages, 1.3.50, and we're able to recreate the issue only by bumping the Kotlin version. Can those who experienced the issue confirm they are using versions of Kotlin >1.3.50?

As the team investigates how to prevent issues like this from happening in the future, we will be releasing the fix proposed by @leonardocustodio soon. Thank you for your time and patience resolving this matter.

@leonardocustodio
Copy link
Contributor

Yes, I'm using kotlin 1.4.32. Had to bump kotlin version because of other packages.
I appreciate the PR but the real kudos goes to @caravanat who proposed the fix :)

@haverchuck haverchuck added pending-release Issues that have been addressed in main but have not been released and removed pending-release Issues that have been addressed in main but have not been released labels Jun 18, 2021
@caravanat
Copy link
Contributor

Thanks @leonardocustodio for the PR... I didn't knew if it was something local here so I just made the change locally until further investigation.

Here we use Kotlin 1.4.30 and others devs here had the same problem using the 0.2.0-nullsafety.0 branch.

@jonbhanson
Copy link

@dnys1 in my case I had the problem with an app using Kotlin version 1.5.10.

@OtmaniCodes
Copy link

does anyone know when will amplify start supporting null safety?

@Ashish-Nanda
Copy link
Contributor

Amplify Flutter 0.2.0 with support for null safety is now released!

Please take a look at the docs for instructions on how to migrate your app

Do let us know if you have any questions or feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A request for a new feature or an enhancement to an existing API or category.
Projects
None yet
Development

No branches or pull requests