[Unity] Issue with empty response when querying large data sets

178 views
Skip to first unread message

Johan Gustafsson

unread,
Feb 9, 2017, 10:50:43 AM2/9/17
to Firebase Google Group
Hello,

I am using the latest 1.1.2 Unity Firebase SDK and I have run into a problem when querying semi-large data sets.
The dataset consists of about 95,000 entries. Each entry looks something like this:

{
   
"score": {"1":"704","4":"731","6":"200","8":"871"},
   
"timestamp":1486647703910,
   
"total_score":2506,
   
"user_id":UID
}

And I query the data like this:
int n = 10;
FirebaseDatabase.DefaultInstance.GetReference("highscore").OrderByChild("timestamp").LimitToLast(n).GetValueAsync().ContinueWith(
    (task) => {
        if (task != null && !task.IsCanceled && !task.IsFaulted && task.IsCompleted) {
            Debug.Log(task.Result.ChildrenCount);
            foreach (var item in task.Result.Children) {
                Debug.Log(item.GetRawJsonValue());
            }
        }
        else {
            Debug.Log("Task returned broken");
        }
    }
);

When I query my database and n is set to 10, everything works fine. I get the 10 latest highscores added to my database and all is well.
However, if I increase the size of n to about 100 or more it stops working. The task will complete and it will enter the first if clause but when logging task.Result.ChildrenCount it says there are 0 children attached to this DataSnapshot.

Am I mis-using GetValueAsync() or am I doing something else wrong when I'm experiencing this behaviour?

I am running Unity 5.5.0f3 and as mentioned Firebase SDK 1.1.2. It is behaving exactly the same when running through the editor as well as on an Android device. Haven't tried iOS.


Best regards,
Johan.

Kato Richardson

unread,
Feb 9, 2017, 12:52:18 PM2/9/17
to Firebase Google Group
Johan,

Could you file a bug here?

☼, Kato

--
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/00b97971-997b-432c-8f32-fd6c2e520fab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Johan Gustafsson

unread,
Feb 9, 2017, 4:39:58 PM2/9/17
to Firebase Google Group
Hello Kato,

I'll do that.


Best regards,
Johan
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/00b97971-997b-432c-8f32-fd6c2e520fab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Benjamin Wulfe

unread,
Feb 9, 2017, 7:11:04 PM2/9/17
to Firebase Google Group
Johan, I am currently investigating this issue.
Can you confirm if you are seeing a log message similar to "keynotfound" (turn on Debug level logging).
If not, could you turn on Debug level logging and attach it to the bug you filed?
Thanks

Regards
-Ben

Johan Gustafsson

unread,
Feb 13, 2017, 10:15:37 AM2/13/17
to Firebase Google Group
Hello Benjamin,

Sorry for my late answer. I've attached the log text and responded to my open bug issue.
I had totally missed that you could change the log level for the Database module.
However, it does seem that the data is being fetched and something goes wrong when trying to parse it into the DataSnapshot?


Best regards,
Johan.

Benjamin Wulfe

unread,
Feb 13, 2017, 1:15:53 PM2/13/17
to Firebase Google Group
Hi Johan, I was able to reproduced the problem locally and I have a fix queued for our next release.  Until we release the fix, you can work around the issue by using Limit with a value less than 25 and OrderBy only on indexed fields.

Regards
-Ben

Johan Gustafsson

unread,
Feb 14, 2017, 10:26:40 AM2/14/17
to Firebase Google Group
Hello Benjamin,

Yes, I managed to conclude that the limit was 25 aswell so I'm using that as of now.
It does kind of break the purpose of the query so I'm still looking forward to the fix.
I know that you probably can't say exact when but do you have a general idea of when to expect the fix(new release)?
Thank you for your quick responses and help!


Best regards,
Johan.

Kato Richardson

unread,
Feb 14, 2017, 1:08:19 PM2/14/17
to Firebase Google Group
Hi Johan,

No ballparks or public release dates we can share, sorry. It mostly just depends on when the next release can be vetted and shipped. Judging by the cadence of Unity releases (i.e. roughly 1 per month), I think you can make some reasonable inferences, but I wouldn't bet the farm on any specific timeline.

☼, Kato


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.

For more options, visit https://groups.google.com/d/optout.

Johan Gustafsson

unread,
Feb 16, 2017, 4:09:24 AM2/16/17
to Firebase Google Group
Hi Kato,

Ok, thanks for the information. I'll be on the lookout.


Best regards,
Johan
Reply all
Reply to author
Forward
0 new messages