string highscoreEntryKey = highscoreRef.Push().Key;
highscoreRef.Child(highscoreEntryKey).SetRawJsonValueAsync(sb.ToString()).ContinueWith( (task) => { if (task.IsCanceled || task.IsFaulted) { callback(false); } else { callback(true); } } );--
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/231c837d-6e42-4939-939c-57c4ff6c1712%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Johan,Does `ContinueWith` trigger after the network connection is reestablished? Obviously, it wouldn't be able to trigger a callback saying that the async write event completed until there is internet connectivity, so that would be my expectation here.☼, Kato
On Mon, Dec 19, 2016 at 7:14 AM, Johan Gustafsson <johan....@gmail.com> wrote:
Hello people,
I using the new Unity SDK in my project and I found something interesting while killing my internet to debug the app.When I auth a user with a Facebook credential I also get a reference to the Firebase database using "highscoreRef = FirebaseDatabase.DefaultInstance.GetReference("highscores");".I do this so I only need to fetch it once and I have noticed that it will speed up subsequent calls to the same reference.After a game round has been completed I push the score to the highscore database using:string highscoreEntryKey = highscoreRef.Push().Key;highscoreRef.Child(highscoreEntryKey).SetRawJsonValueAsync(sb.ToString()).ContinueWith((task) => {if (task.IsCanceled || task.IsFaulted) {callback(false);}else {callback(true);}});
However, I found that if I cut the internet connection between getting the first database ref and pushing to the database, the "highscoreRef.Child(highscoreEntryKey).SetRawJsonValueAsync(sb.ToString())" will not work properly.First of all it's ContinueWith thread will never fire and secondly it seems that it fails completely silent so I have no way of detecting if the operation was successful or not.
Is this the expected behaviour and if so how can I make sure that it will fail before calling it so I know how to script the game's behaviour correctly.Best regards Johan
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/231c837d-6e42-4939-939c-57c4ff6c1712%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Well, the options here are 1) A Firebase bug is preventing reconnect, 2) Authentication creds are expiring while offline and not being re-established before the write event takes place or 3) something in security rules is causing the write to be rejected (I supposed we’d still expect the callback to trigger in #3).
It’ll help to include all the relevant code, sample data, debug logging, and version info so we can fully understand the problem. See how to ask and creating an mcve.
☼, 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/b3d74282-824f-4125-a5ec-baa633f91dee%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/b3d74282-824f-4125-a5ec-baa633f91dee%40googlegroups.com.