aws-amplify / amplify-flutter

A declarative library with an easy-to-use interface for building Flutter applications on AWS.
https://docs.amplify.aws
Apache License 2.0
1.31k stars 243 forks source link

Debugger pauses in `aws_retryer.dart` when using Flutter 3.16 #4345

Closed seanhamstra closed 7 months ago

seanhamstra commented 8 months ago

Description

1.4.1 and 1.6.1 amplify libraries. Tried a few different setups. Exact same packages and version with fluter 3.13.7 and I do not see this exception. Upgrade to flutter 3.16.7 and it occurs.

Exception is always the same spot for sign out and sign in. When you continue the app works as expected, auth is all good and able to fetch data etc. Nothing appears broken.

Exception throws in aws_retryer.dart line 196 (image attached). Seems to happen with smithy_aws-0.6.1 and 0.5.1. Not sure what with the flutter upgrade would cause this, but that's the only thing changed...

Categories

Steps to Reproduce

No response

Screenshots

Screenshot 2024-01-16 at 3 35 06 PM

Platforms

Flutter Version

3.16.7

Amplify Flutter Version

1.6.1

Deployment Method

Amplify CLI

Schema

No response

Equartey commented 8 months ago

Hi @seanhamstra sorry to hear you've ran into this exception.

I'm unable to reproduce this on my end.

I was testing using:

Is this correct?

In your IDE do you have it set to stop at all exceptions?

Are you able to reproduce this on a minimal example app?

Can you please provide your full pubspec.yaml file?

seanhamstra commented 8 months ago

Thanks, @Equartey! Was "Flutter: 1.6.7" a mistype? 3.16.7 perhaps?

I only have "Uncaught Exceptions" enabled.

Screenshot 2024-01-18 at 9 05 15 AM

No, I haven't not setup a minimal example project at this time.

Here is the pubspec though:

name: someApp
description: someApp
version: 1.0.0+10
publish_to: none

environment:
  sdk: ">=3.0.5 <4.0.0"
  flutter: 3.13.7

dependencies:
  amplify_api: ^1.6.2
  amplify_auth_cognito: ^1.6.1
  amplify_core: ^1.6.1
  amplify_flutter: ^1.6.1
  auto_route: ^5.0.2
  auto_size_text: ^3.0.0
  bloc: ^8.1.0
  carousel_slider: ^4.1.1
  collection: ^1.17.1
  connectivity_plus: ^5.0.2
  convert: ^3.1.1
  dartz: ^0.10.1
  device_info_plus: ^9.0.0
  dio: ^5.2.1
  dio_smart_retry: ^6.0.0
  dotted_border: ^2.1.0
  dynamic_color: ^1.6.6
  firebase_analytics: ^10.4.3
  firebase_core: ^2.15.1
  firebase_crashlytics: ^3.3.5
  firebase_performance: ^0.9.2+5
  flutter:
    sdk: flutter
  flutter_animate: ^4.2.0+1
  flutter_app_badger: ^1.5.0
  flutter_bloc: ^8.1.1
  flutter_cache_manager: ^3.3.1
  flutter_fgbg: ^0.3.0
  flutter_local_notifications: ^15.1.0+1
  flutter_localizations:
    sdk: flutter
  flutter_native_splash: ^2.3.4
  flutter_native_timezone: ^2.0.0
  flutter_reactive_ble: ^5.2.0
  flutter_slidable: ^3.0.0
  flutter_svg: ^2.0.7
  freezed_annotation: ^2.1.0
  get_it: ^7.6.4
  grouped_list: ^5.1.2
  image_picker: ^1.0.4
  internet_connection_checker: ^1.0.0+1
  intl: ^0.18.0
  isar: ^3.1.0+1
  isar_flutter_libs: ^3.1.0+1
  json_annotation: ^4.8.1
  layout: ^1.0.5
  loader_overlay: ^2.3.2
  loading_animation_widget: ^1.2.0+4
  logging: ^1.1.0
  lottie: ^2.6.0
  mobile_scanner: ^2.0.0
  native_device_orientation: ^1.1.4
  package_info_plus: ^4.2.0
  path_drawing: ^1.0.1
  path_provider: ^2.1.1
  permission_handler: ^11.0.0
  photo_view: ^0.14.0
  platform: ^3.1.2
  push: ^1.0.1
  quickalert: ^1.0.2
  reactive_forms: ^14.3.0
  result_dart: ^1.1.0
  rxdart: ^0.27.7
  sentry_flutter: ^7.10.1
  share_plus: ^7.2.1
  shared_preferences: ^2.2.1
  smooth_page_indicator: ^1.0.0+2
  timeago_flutter: ^3.5.0
  timezone: ^0.9.2
  url_launcher: ^6.1.14
  uuid: ^3.0.7

dev_dependencies:
  auto_route_generator: ^5.0.2
  bloc_test: ^9.1.0
  build_runner: ^2.4.6
  flutter_gen_runner:
  flutter_test:
    sdk: flutter
  freezed: ^2.4.1
  isar_generator: ^3.1.0+1
  json_serializable: ^6.7.1
  mocktail: ^1.0.0
  very_good_analysis: ^5.1.0

# Make sure freezed runs before isar for models that utilize both
global_options:
  freezed:freezed:
    runs_before:
      - isar_generator:isar_generator

flutter:
  uses-material-design: true
  generate: true
  assets:
    - assets/fonts/
    - assets/gifs/
    - assets/images/
    - assets/lottie/

flutter_gen:
  integrations:
    flutter_svg: true
    lottie: true
Equartey commented 8 months ago

@seanhamstra ah my bad, yah I'm on Flutter 3.16.7.

Thanks for the additional details.

I've been able to reproduce the issue. I'm currently investigating and will provide an update when I can.

Equartey commented 8 months ago

@seanhamstra do you get the same exception UnsupportedOperationException every time?

Can you also share your amplifyconfiguration.json, at least the auth section, with any sensitive info removed?

Jordan-Nelson commented 8 months ago

I can reproduce this issue on Flutter 3.16.0, but cannot on Flutter 3.13.9. We have had a similar issue to this (see: https://github.com/aws-amplify/amplify-flutter/issues/2718) that was resolved. It seems like something changed in the latest version of Flutter or Dart that is causing this to surface again. It isn't clear if this is actually a bug in Amplify Flutter or if this is a bug in Flutter/Dart. We will need to spend some time investigating it.

I wanted to note that I cannot repro the exact same exception you are seeing (UnsupportedOperationException). I think that exception might be specific to your configuration. If you can share your auth config we might be able to confirm that.

Jordan-Nelson commented 8 months ago

I was able to create a minimal repro of this issue and opened an issue in the Flutter repo (see: https://github.com/flutter/flutter/issues/141882).

I think we can workaround this though. I will look into a workaround and try to get a PR open.

Jordan-Nelson commented 8 months ago

I have a PR up that should resolve this. You can test this out by manually changing 4 lines of code in aws_retryer.dart. You do not need to make the other changes in that PR.

Jordan-Nelson commented 8 months ago

The PR has been merged and should be included in the next release. In the meantime you can pull in this change by adding the following line to your pubspec.yaml file.

dependency_overrides:
  smithy_aws:
    git:
      url: https://github.com/aws-amplify/amplify-flutter.git
      path: packages/smithy/smithy_aws
seanhamstra commented 8 months ago

@Jordan-Nelson that works. Thank you!!

haverchuck commented 7 months ago

This is fixed on amplify flutter 1.6.3.