question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[CRASH + DISCUSSION] Should we request Twitter email transparently?

See original GitHub issue

While working on another PR, I came across this crash:

12-03 12:05:15.217 16688-16688/com.firebase.uidemo E/AndroidRuntime: FATAL EXCEPTION: main
                                                                     Process: com.firebase.uidemo, PID: 16688
                                                                     java.lang.IllegalArgumentException: Given String is empty or null
                                                                         at com.google.android.gms.common.internal.zzac.zzdv(Unknown Source)
                                                                         at com.google.firebase.auth.FirebaseAuth.fetchProvidersForEmail(Unknown Source)
                                                                         at com.firebase.ui.auth.ui.idp.CredentialSignInHandler.onComplete(CredentialSignInHandler.java:73)
                                                                         at com.google.android.gms.tasks.zzc$1.run(Unknown Source)
                                                                         at android.os.Handler.handleCallback(Handler.java:751)
                                                                         at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                         at android.os.Looper.loop(Looper.java:154)
                                                                         at android.app.ActivityThread.main(ActivityThread.java:6088)
                                                                         at java.lang.reflect.Method.invoke(Native Method)
                                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

It’s caused by this line of code and occurs if a user has an existing account and there is a FirebaseAuthUserCollisionException.

To solve this problem, there are two solutions:

  1. Check for a null email in CredentialSignInHandler and fail the sign in if the email is null.
  2. Use TwitterAuthClient#requestEmail to show the request email activity.

I prefer solution 2 because we are being more transparent about requesting a user’s email, but it requires more steps and a Twitter user might not have an email: https://docs.fabric.io/android/twitter/log-in-with-twitter.html#request-user-email-address

@samtstern @amandle What should we do?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
SUPERCILEXcommented, Dec 15, 2016

@cutiko You’re totally fine, that’s why FirebaseUI has public issues! 😄

In my case the problem happened when the email was requested for Twitter but the email was already in use. Initially the login was done using google and then later using Twitter, the email is the same in both.

@samtstern Hopefully my comment and the above will help you understand why we need the email. Adding the null check in CredentialSignInHandler fixes the crash for Twitter users without an email, but we still need the email before the user is signed to perform linking for Twitter users with an email.

@cutiko Yes, the plan is to force you guys to request the email permission (or at least if you don’t neither account linking nor Smart Lock will work).

The fix should be out by FirebaseUI v1.1.0! 🎉

0reactions
samtsterncommented, Jan 12, 2017

A fix for this issue has been released in version 1.1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to recognize authentic Twitter emails | Twitter Help
Learn the features of real emails from Twitter that you can trust, and how to recognize and avoid fraudulent emails.
Read more >
- TWITTER: TRANSPARENCY AND ACCOUNTABILITY
When you and your co-creators founded Twitter in 2006, you probably never envisioned the issues we are going to discuss today: so-called ``shadow-banning,'' ......
Read more >
The weird sorrow of losing Twitter - Vox
So, yes, there is a reason to mourn. The reality is that this is a hard time: Even if Twitter doesn't collapse, it...
Read more >
A travel writer tweeted her salary and reignited a trend
The tweet started a conversation about pay transparency and how it can ... if you apply for my old job as Senior Travel...
Read more >
When Journalists Tweet: Disclosure, Participatory, and ...
It also answers a call from previous researchers on transparency on Twitter ... Twitter indeed discuss how the news are produced (disclosure transparency), ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found