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

[firebase_auth]: platformExceptionToFirebaseAuthException throws TypeErrors #16971

Open
1 task done
stx opened this issue Jan 14, 2025 · 7 comments
Open
1 task done
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. Needs Attention This issue needs maintainer attention. platform: ios Issues / PRs which are specifically for iOS. plugin: auth type: bug Something isn't working

Comments

@stx
Copy link

stx commented Jan 14, 2025

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Auth

Which platforms are affected?

iOS

Description

platformExceptionToFirebaseAuthException appears to be missing some handling:

TypeError: type 'String' is not a subtype of type 'Map<dynamic, dynamic>?'
  #0      platformExceptionToFirebaseAuthException (package:firebase_auth_platform_interface/src/method_channel/utils/exception.dart:48)
  #1      convertPlatformException (package:firebase_auth_platform_interface/src/method_channel/utils/exception.dart:27)
  #2      MethodChannelFirebaseAuth.signInWithProvider (package:firebase_auth_platform_interface/src/method_channel/method_channel_firebase_auth.dart:406)
  File "<asynchronous suspension>"
  #4      FirebaseAuth.signInWithProvider (package:firebase_auth/src/firebase_auth.dart:641)
  File "<asynchronous suspension>"

Reproducing the issue

FirebaseAuth.instance.signInWithProvider(GoogleAuthProvider())

Exact triggering error from Google is unknown.

Firebase Core version

3.10.0

Flutter Version

3.27.1

Relevant Log Output

Flutter dependencies

Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.

Additional context and comments

No response

@stx stx added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Jan 14, 2025
@stx stx changed the title [firebase_auth]: [firebase_auth]: platformExceptionToFirebaseAuthException throws TypeErrors Jan 14, 2025
@SelaseKay SelaseKay added plugin: auth platform: ios Issues / PRs which are specifically for iOS. labels Jan 14, 2025
@SelaseKay
Copy link
Contributor

Hi @stx, I'm unable to reproduce this issue. Could you provide a complete minimal code that reproduces this?

@SelaseKay SelaseKay added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Jan 14, 2025
@stx
Copy link
Author

stx commented Jan 14, 2025

There is no Flutter code to reproduce the Google-side error.

These are production issues coming in from a large app so we're not sure what the triggering error is on the Google account.

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Jan 14, 2025
@SelaseKay SelaseKay added resolution: needs-repro This issue could not be reproduced or needs an up to date reproduction on latest FlutterFire plugin. and removed Needs Attention This issue needs maintainer attention. labels Jan 15, 2025
@Lyokone Lyokone removed the resolution: needs-repro This issue could not be reproduced or needs an up to date reproduction on latest FlutterFire plugin. label Jan 21, 2025
@Lyokone
Copy link
Contributor

Lyokone commented Jan 21, 2025

Hello, without reproducible code, we are not going to be able to help you. Check the demo code to see if you can find the issue in your code:
https://github.com/firebase/flutterfire/blob/main/packages/firebase_auth/firebase_auth/example/lib/auth.dart#L546

@Lyokone Lyokone added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Jan 21, 2025
@stx
Copy link
Author

stx commented Jan 21, 2025

@Lyokone how can a mishandled type in an internal exception in a plugin be an "issue with my code"?

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Jan 21, 2025
@Lyokone
Copy link
Contributor

Lyokone commented Jan 21, 2025

The fact that we cannot reproduce it makes me think you might be misusing the plugin. I would love to improve our error handling, but the first step is for you to provide a reproducible sample.
Are you unable to provide code to reproduce the issue?

@Lyokone Lyokone added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Jan 21, 2025
@stx
Copy link
Author

stx commented Jan 21, 2025

The code to reproduce the issue is in the original post.

@google-oss-bot google-oss-bot removed the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Jan 21, 2025
@Lyokone
Copy link
Contributor

Lyokone commented Jan 21, 2025

@stx A reproducible sample is a complete GitHub repo I can just clone and start on my end. A one-liner isn't a complete reproducible sample.

@Lyokone Lyokone added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. Needs Attention This issue needs maintainer attention. platform: ios Issues / PRs which are specifically for iOS. plugin: auth type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants