[Unity][Firebase 5.3.0] Database GetValueAsync() no responce

375 views
Skip to first unread message

Stanislav Kalyuk

unread,
Oct 12, 2018, 1:55:31 PM10/12/18
to Firebase Google Group
I've got the problem with GetValueAsync. First time when user creates account. Everything works. When admin delete user account from database. GetValueAsync stops to responce.
This problem was on 4.5.2 too.
Database screenshot at path (root/Users/):
Записати.JPG
Call:
_usersReference.Child(userId).Child("LastSaveTime").GetValueAsync().ContinueWith(onDataDownloaded);
Response task:
private static void OnDataDownloaded(Task<DataSnapshot> obj)
{
   
Debug.Log("Done!");
   
if (obj.IsFaulted || obj.IsCanceled)
   
{
       
Debug.LogError("Database Error: " + obj.Exception);
   
}
   
else
   
{
        _downloadedSnapshot
= obj.Result;
   
}
}

Shawn Kuang

unread,
Oct 15, 2018, 8:37:06 PM10/15/18
to Firebase Google Group

Hi Stanislav,

I'd like to learn a bit more about your situation.
  • Which platform does this problem occur on?  (Android/iOS/Windows/OSX/Linux)
  • What is your database security rules at that location?  (_usersReference.Child(userId).Child("LastSaveTime"))
  • After the admin delete the user account, what is the value of "userId"?
  • Any unusual message in your log?
  • We just released 5.3.1.  Could you try and see if the latest version resolve your issue?
Thank you,
Shawn

Rajesharun Rajesharun

unread,
Oct 16, 2018, 9:55:09 AM10/16/18
to fireba...@googlegroups.com

Thank you

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/b2498eb3-5861-4613-8736-a957283b8d68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

nikhil vyas

unread,
Oct 17, 2018, 10:33:21 AM10/17/18
to fireba...@googlegroups.com
1) I am using for android app
2) database security rules are public
3) Unusual message :  Unsupported class loader, W/zygote: Skipping duplicate class check due to unsupported classloader , I/DynamiteModule: Considering local module com.google.android.gms.firebase_database:4 and remote module com.google.android.gms.firebase_database:6 , W/PersistentConnection: pc_0 - Using an unspecified index. Consider adding '".indexOn": "user_id"' at user_photos/QmUXIxC8tXWH4YIqBYSAuirrJgo1 to your security and Firebase Database rules for better performance
4) Gradle i am using : compile 'com.google.firebase:firebase-auth:10.2.6'
//firebase database
compile 'com.google.firebase:firebase-database:10.2.6'
//firebase storage
compile 'com.google.firebase:firebase-storage:10.2.6'
 


Thank you

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/b2498eb3-5861-4613-8736-a957283b8d68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

Shawn Kuang

unread,
Oct 22, 2018, 9:49:19 PM10/22/18
to Firebase Google Group
Hi Nikhil,

By "When admin delete user account from database. ", does the admin delete the account from Firebase Authentication?  Or the admin deleted a field in Realtime Database?  Given the screenshot, I assume it is the latter one.

If that is the case, could you try to catch Exception inside your OnDataDownloaded() function?  I do notice that if the data at the request does not exist, obj.Result would be null instead of a DataSnapshot with a null value.
But obj.Result is not null when play in editor. 
Please try to catch the exception or check if the result is null, and see if it resolve your problem.  

Also note that, if you are using Unity 2018, or if you switch to use .NET 4.0+, ContinueWith() does not run on main thread.  Please be aware of the threading issue.  You can either lock the value you need to access in a different thread, or cache and schedule to process result in main thread. 

Regards,
Shawn
Reply all
Reply to author
Forward
0 new messages