-
Notifications
You must be signed in to change notification settings - Fork 4k
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] Error code with non-English character #3633
Comments
Hi @altayhunoglu,
I tried below code sample on latest stable (1.20.4) code sample
Can you try the official plugin example and see if you still get the same behavior ? |
Hello @darshankawar, First of all, may I ask if you know why it is not "ERROR_EMAIL_ALREADY_IN_USE" but "email-already-in-use" instead? There must be some kind of conversion to lowercase and it causes the problem as my machine was once in Turkish. In Turkish the lowercase of "I" is "ı" So, indeed I can simply solve this individual problem like that:
|
Actually the correct question should be why there isn't an enum provided by firebase_auth that we can access to compare the error codes? Not very nice to compare with plain string specially when firebase changes those strings -.- |
@leonardocustodio you'd still have the same problem though right? In order to generate an enum value you need to know the string value, which in this case seems to be a language problem so the enums wouldn't match up anyway. @altayhunoglu Are you running anything "none standard" here? E.g. an emulator with a different language set etc? Would be interesting to replicate this. |
@Ehesp yes, it wouldn't match if firebase changed the string values and the firebase auth package doesn't but as I said in the #3402 in my opinion at least, it's way easier to the package to keep uptodate with firebase string values than each developer alone. Also, when the package is responsible for that there is a lot of developers that can spot that the strings have changed and open an issue to report or make a pull request to fix it. But a developer alone, if he doesn't check often if the values haven't changed who knows how much time it will take for him to know the app isn't working as expected. I know there is no perfect solution but from where I see this one looks the less painful one. But I could be wrong ;) |
The native errors (e.g. permission denied) need to be converted to Dart-land code so this will always be required. That discussion is for the other PR anyway. This is an issue which needs fixing regardless though - hopefully it can be replicated easily. |
@Ehesp hello, You are right. I use emulator in Turkish. I will try after changing the language, as soon as possible. |
Hey @altayhunoglu. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Since there haven't been any recent updates here, I am going to close this issue. @altayhunoglu if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this. |
we have the same problem.. I could fix this problem by using toUpperCase method but it does not work. Because somehow, it behaves very turkic. That means "ınvalıd-emaıl".toUpperCase() == "INVALID_EMAIL" it returns false. So this problem occurred after the update. language of my partner's computer is Turkish and mine is English. and I see the error as expected. I/flutter (25906): firebase_auth/invalid-email] The email address is badly formatted. so somehow, the latest version of the package, uses windows's system language for the error codes.. Hope it helps for solving this problem. |
Bug report
Error code with non-English character.
API: firebase_auth: 0.18.0+1.
Example:
The error code "email-already-in-use" looks like this:
emaıl-already-ın-use
Steps to reproduce
Steps to reproduce the behavior:
[firebase_auth/emaıl-already-ın-use] The email address is already in use by another account.
Expected behavior
Error code only in English characters.
Flutter doctor
Click To Expand
Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
The text was updated successfully, but these errors were encountered: