{"action":"created","issue":{"url":"https://api.github.com/repos/SUPERCILEX/FirebaseUI-Android/issues/29","repository_url":"https://api.github.com/repos/SUPERCILEX/FirebaseUI-Android","labels_url":"https://api.github.com/repos/SUPERCILEX/FirebaseUI-Android/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/SUPERCILEX/FirebaseUI-Android/issues/29/comments","events_url":"https://api.github.com/repos/SUPERCILEX/FirebaseUI-Android/issues/29/events","html_url":"https://github.com/SUPERCILEX/FirebaseUI-Android/issues/29","id":356208552,"node_id":"MDU6SXNzdWUzNTYyMDg1NTI=","number":29,"title":"Updating a Phone Number: \"User has already been linked to the given provider\"","user":{"login":"kiptoomm","id":1447912,"node_id":"MDQ6VXNlcjE0NDc5MTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1447912?v=4","gravatar_id":"","url":"https://api.github.com/users/kiptoomm","html_url":"https://github.com/kiptoomm","followers_url":"https://api.github.com/users/kiptoomm/followers","following_url":"https://api.github.com/users/kiptoomm/following{/other_user}","gists_url":"https://api.github.com/users/kiptoomm/gists{/gist_id}","starred_url":"https://api.github.com/users/kiptoomm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiptoomm/subscriptions","organizations_url":"https://api.github.com/users/kiptoomm/orgs","repos_url":"https://api.github.com/users/kiptoomm/repos","events_url":"https://api.github.com/users/kiptoomm/events{/privacy}","received_events_url":"https://api.github.com/users/kiptoomm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-01T14:56:52Z","updated_at":"2018-09-01T20:02:20Z","closed_at":"2018-09-01T20:02:20Z","author_association":"NONE","body":"\r\n### My environment\r\n\r\n  * Android device: Oppo A37fw\r\n  * Android OS version: 5.1.1\r\n  * Google Play Services version: 15.0.0\r\n  * Firebase/Play Services SDK version: 15.0.0\r\n  * FirebaseUI version: `com.github.SUPERCILEX.FirebaseUI-Android:firebase-ui-auth:7382a75` (latest master)\r\n  \r\n### The problem:\r\n\r\nI'm having an issue similar to a https://github.com/firebase/FirebaseUI-Android/issues/1275 but with phone numbers. I would like for my users to be able to update their auth phone numbers as they wish. \r\n\r\n#### Steps to reproduce:\r\n\r\n  1. Perform the firebase-ui auth flow with the phone number option\r\n  2. Enter user's phone number\r\n  3. Verify phone number (confirmation code entered)\r\n  4. Log out user\r\n  5. Repeat step 1 to 3 \r\n  \r\n#### Observed Results:\r\n\r\n  \r\n<img width=\"306\" alt=\"screen shot 2018-09-01 at 5 52 03 pm\" src=\"https://user-images.githubusercontent.com/1447912/44947052-c81ebc00-ae0f-11e8-891f-df4d23cd2f92.png\">\r\n\r\n\r\nStacktrace:\r\n\r\n`09-01 17:34:20.764 21008-21008/app.example.android E/AuthUI: A sign-in error occurred.\r\n    com.google.firebase.FirebaseException: User has already been linked to the given provider.\r\n        at com.google.firebase.auth.api.internal.zzce.zzb(Unknown Source)\r\n        at com.google.firebase.auth.api.internal.zzao.zzd(Unknown Source)\r\n        at com.google.firebase.auth.FirebaseAuth.zzc(Unknown Source)\r\n        at com.google.firebase.auth.FirebaseUser.linkWithCredential(Unknown Source)\r\n        at com.firebase.ui.auth.util.accountlink.AccountLinker.start(AccountLinker.java:82)\r\n        at com.firebase.ui.auth.util.accountlink.AccountLinker.<init>(AccountLinker.java:52)\r\n        at com.firebase.ui.auth.util.accountlink.AccountLinker.linkWithCurrentUser(AccountLinker.java:58)\r\n        at com.firebase.ui.auth.viewmodel.phone.PhoneProviderResponseHandler.startSignIn(PhoneProviderResponseHandler.java:37)\r\n        at com.firebase.ui.auth.ui.phone.PhoneActivity$2.onSuccess(PhoneActivity.java:87)\r\n        at com.firebase.ui.auth.ui.phone.PhoneActivity$2.onSuccess(PhoneActivity.java:79)\r\n        at com.firebase.ui.auth.viewmodel.ResourceObserver.onChanged(ResourceObserver.java:68)\r\n        at com.firebase.ui.auth.viewmodel.ResourceObserver.onChanged(ResourceObserver.java:18)\r\n        at android.arch.lifecycle.LiveData.considerNotify(LiveData.java:109)\r\n        at android.arch.lifecycle.LiveData.dispatchingValue(LiveData.java:126)\r\n        at android.arch.lifecycle.LiveData.setValue(LiveData.java:282)\r\n        at android.arch.lifecycle.MutableLiveData.setValue(MutableLiveData.java:33)\r\n        at com.firebase.ui.auth.viewmodel.OperableViewModel.setResult(OperableViewModel.java:24)\r\n        at com.firebase.ui.auth.ui.phone.PhoneNumberVerificationHandler.submitVerificationCode(PhoneNumberVerificationHandler.java:61)\r\n        at com.firebase.ui.auth.ui.phone.SubmitConfirmationCodeFragment.submitCode(SubmitConfirmationCodeFragment.java:219)\r\n        at com.firebase.ui.auth.ui.phone.SubmitConfirmationCodeFragment.access$100(SubmitConfirmationCodeFragment.java:45)\r\n        at com.firebase.ui.auth.ui.phone.SubmitConfirmationCodeFragment$2.onClick(SubmitConfirmationCodeFragment.java:147)\r\n        at android.view.View.performClick(View.java:4781)\r\n        at android.view.View$PerformClick.run(View.java:19907)\r\n        at android.os.Handler.handleCallback(Handler.java:739)\r\n        at android.os.Handler.dispatchMessage(Handler.java:95)\r\n        at android.os.Looper.loop(Looper.java:160)\r\n        at android.app.ActivityThread.main(ActivityThread.java:5541)\r\n        at java.lang.reflect.Method.invoke(Native Method)\r\n        at java.lang.reflect.Method.invoke(Method.java:372)\r\n        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)\r\n        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)`\r\n  \r\n#### Expected Results:\r\n\r\n  * Phone number is successfully changed/updated\r\n  \r\n#### Relevant Code:\r\n\r\n  ```\r\nclass ExampleMergeService: ManualMergeService() {\r\n    override fun onLoadData(): Task<Void>? {\r\n        //val loadTask = TaskCompletionSource<Void>()\r\n        return null //loadTask.task\r\n    }\r\n\r\n    override fun onTransferData(response: IdpResponse?): Task<Void>? {\r\n        return null\r\n    }\r\n}\r\n\r\n val providers = Arrays.asList(\r\n                AuthUI.IdpConfig.PhoneBuilder().build())\r\n\r\n  startActivityForResult(\r\n                AuthUI.getInstance()\r\n                        .createSignInIntentBuilder()\r\n                        .setAvailableProviders(providers)\r\n                        .setIsSmartLockEnabled(!BuildConfig.DEBUG, true) // disable smart lock for dev/test\r\n                        .setIsAccountLinkingEnabled(true, ExampleMergeService::class.java)\r\n                        .build(),\r\n                requestCode)\r\n\r\n\r\n  ```\r\n"},"comment":{"url":"https://api.github.com/repos/SUPERCILEX/FirebaseUI-Android/issues/comments/417883844","html_url":"https://github.com/SUPERCILEX/FirebaseUI-Android/issues/29#issuecomment-417883844","issue_url":"https://api.github.com/repos/SUPERCILEX/FirebaseUI-Android/issues/29","id":417883844,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzg4Mzg0NA==","user":{"login":"SUPERCILEX","id":9490724,"node_id":"MDQ6VXNlcjk0OTA3MjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/9490724?v=4","gravatar_id":"","url":"https://api.github.com/users/SUPERCILEX","html_url":"https://github.com/SUPERCILEX","followers_url":"https://api.github.com/users/SUPERCILEX/followers","following_url":"https://api.github.com/users/SUPERCILEX/following{/other_user}","gists_url":"https://api.github.com/users/SUPERCILEX/gists{/gist_id}","starred_url":"https://api.github.com/users/SUPERCILEX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUPERCILEX/subscriptions","organizations_url":"https://api.github.com/users/SUPERCILEX/orgs","repos_url":"https://api.github.com/users/SUPERCILEX/repos","events_url":"https://api.github.com/users/SUPERCILEX/events{/privacy}","received_events_url":"https://api.github.com/users/SUPERCILEX/received_events","type":"User","site_admin":false},"created_at":"2018-09-01T20:02:20Z","updated_at":"2018-09-01T20:02:20Z","author_association":"OWNER","body":"Unfortunately, neither my fork nor the official repo supports any sort of profile updates, but it is [planned](https://github.com/firebase/FirebaseUI-Android/issues/235). To clear up any confusion, my fork is meant to link two _different_ accounts together."}}
{"actor":{"display_login":"SUPERCILEX"}}