chat-sdk-android icon indicating copy to clipboard operation
chat-sdk-android copied to clipboard

Problem when trying to open an existing thread from contacts list

Open RyanElliott94 opened this issue 9 years ago • 5 comments

So I'm currently working on the 3rd update and I've come across a problem and that is with trying to open an existing thread from the contacts!

When you click a user from the contacts list but if that user has an old thread the app will crash

Here's the Logcat:

     04-21 13:31:11.501 7692-7692/com.skintmedia.voice E/AndroidRuntime: FATAL EXCEPTION: main
     Process: com.skintmedia.voice, PID: 7692
     java.lang.IllegalStateException: Deferred object already finished, cannot resolve again
     at org.jdeferred.impl.DeferredObject.resolve(DeferredObject.java:64)
     at com.braunster.androidchatsdk.firebaseplugin.firebase.ThreadRecovery$3$1.onDataChange(ThreadRecovery.java:123)
    at com.google.firebase.database.Query$1.onDataChange(Unknown Source)
    at com.google.android.gms.internal.zzbpx.zza(Unknown Source)
    at com.google.android.gms.internal.zzbqx.zzZS(Unknown Source)
    at com.google.android.gms.internal.zzbra$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:6119)
    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)

RyanElliott94 avatar Apr 21 '17 13:04 RyanElliott94

Hi @RyanElliott94,

Can you confirm exactly what you mean by old thread? I assume this is to do with updating the code from the old version to the new version? To fix this you will need to add some code to check the type of the thread (old or new) and then change how you deal with it accordingly. Ideally we would upgrade the old thread to a new thread each time meaning we slowly phase out the old system.

To help me troubleshoot this issue it would be good to know how the old threads differ from the new ones. @kykrueger might be able to shed some light on this. Are they different in the Firebase data, the stored Android object data or in a different way?

Simon

simonsmiley64 avatar May 01 '17 10:05 simonsmiley64

Hello, so far i haven't had this problem again and that may be down to the fact that i have completely changed how contacts are added and read!

RyanElliott94 avatar May 01 '17 11:05 RyanElliott94

Hi @RyanElliott94,

That could have been it. I normally recommend deleting the app and the test Firebase data to ensure the app is starting from a fresh position. If everything is working now I wouldn't worry about it.

If this problem reoccurs then just create another issue with the details of the problem and we can look into it.

Simon

simonsmiley64 avatar May 01 '17 13:05 simonsmiley64

I'm getting this bug as well... and it's consistent: whenever I'm in "pick friends" fragment and try to start a conversation with a user, who I already have (or even used to have) a conversation with, the bug above appears

dorekhov1 avatar Jul 20 '17 22:07 dorekhov1

Even i was getting the same error from morning i was not able to fix it till evening, then i realised that am using two google-services.json file one for project app level and another one for firebase_plugin level and both are created from two different accounts. then i generated both files from same account as given here https://www.youtube.com/watch?v=VZkLfXt_ibo and it started working

rahulsharmagbpec avatar Oct 11 '17 14:10 rahulsharmagbpec