Open anasqadrei opened 9 months ago
Reproducible using the code sample and the steps provided above.
See the recording below. The video ends at step 11 because the it doesn't take more than 5 seconds for the UID to show up when the user is authenticated, but it does in this case. If I do continue to step 13 it doesn't take long for the data to show up.
https://github.com/firebase/flutterfire/assets/88313112/d8eda6ee-450a-46d8-bb9e-8d7c51c2268a
PS: I'm unable to confirm whether this reproduces on android as well, at the moment.
cc @russellwheatley
Bug report
Describe the bug
I'm trying to implement delete user functionality on my app. Delete requires that user reauthenticates before deletion. It works fine except in case user changes their mind last minute and cancel the reauthentication. The cancellation is also fine except when they sign out then try to sign in again. Sign out works fine but sign in doesn't do anything. The three methods
authStateChanges
,idTokenChanges
anduserChanges
don't get triggered. That happens once. It works if the user try to sign in for the second time. That's a bad user experience anyway.Steps to reproduce
Steps to reproduce the behavior:
firebase_core
andfirebase_auth
dependencies and include the code below inmain.dart
Expected behavior
Step 11 above should be a successful sign in and your firebase UID should be shown
Sample project
Here is a
main.dart
Additional context
I feel the problem is in
reauthenticateWithProvider
somewhereFlutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
``` Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.13.8, on macOS 14.1.2 23B92 darwin-arm64, locale en-AU) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.85.1) [✓] Connected device (4 available) [✓] Network resources • No issues found! ```Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
``` Dart SDK 3.1.4 Flutter SDK 3.13.8 flutter_firebase_apple_signin 0.1.0 dependencies: - firebase_auth 4.15.3 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 2.24.2 [firebase_core_platform_interface firebase_core_web flutter meta] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math web sky_engine] dev dependencies: - flutter_lints 2.0.3 [lints] - flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math async boolean_selector characters collection material_color_utilities meta source_span stream_channel string_scanner term_glyph web] transitive dependencies: - _flutterfire_internals 1.3.16 [collection firebase_core firebase_core_platform_interface flutter meta] - async 2.11.0 [collection meta] - boolean_selector 2.1.1 [source_span string_scanner] - characters 1.3.0 - clock 1.1.1 - collection 1.17.2 - fake_async 1.3.1 [clock collection] - firebase_auth_platform_interface 7.0.9 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 5.8.12 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser js meta] - firebase_core_platform_interface 5.0.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.10.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math web] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - js 0.6.7 [meta] - lints 2.1.1 - matcher 0.12.16 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.5.0 [collection] - meta 1.9.1 - path 1.8.3 - plugin_platform_interface 2.1.7 [meta] - sky_engine 0.0.99 - source_span 1.10.0 [collection path term_glyph] - stack_trace 1.11.0 [path] - stream_channel 2.1.1 [async] - string_scanner 1.2.0 [source_span] - term_glyph 1.2.1 - test_api 0.6.0 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph] - typed_data 1.3.2 [collection] - vector_math 2.1.4 - web 0.1.4-beta ```