GetValueAsync() in Realtime Database often enters infinite wait
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 32/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- database, mobile-dev
Research direction
Start with the LoadID coroutine and the GetUserReference().Child("logs").GetValueAsync() call, then reproduce on Unity 2021.3.29 targeting Android with Firebase Unity SDK 10.0.1. Compare the email and Facebook authentication paths and capture task completion, cancellation, or fault details; done means the read returns or reports a handled failure instead of waiting indefinitely.
Written by the indexing model from the issue text.
Description
[REQUIRED] Please fill in the following fields:
- Unity editor version: 2021.3.29
- Firebase Unity SDK version: 10.0.1
- Source you installed the SDK: Unity Package Manager
- Problematic Firebase Component: RealtimeDatabase
- Other Firebase Components in use: Auth
- Additional SDKs you are using: Facebook, UnityAds, Google playgames services
- Platform you are using the Unity editor on: Windows
- Platform you are targeting: Android
- Scripting Runtime: Mono and IL2CPP
[REQUIRED] Please describe the issue here:
In yesterday, reading and writing data was working fine.
However, this morning when I opened the editor to test the game, I was often unable to read the data in the database. I tried different login methods, including Email and Facebook. Among them, FB could not receive the data every time I executed it, while email is some times good and some times bad, and even if it receive data, it is also from the past.
After searching with different prints, I found that the problem lies here: GetUserReference().Child("logs").GetValueAsync();
I used a coroutine to execute this function. I found that when it reaches this line, it often waits indefinitely and then there is no result.
Relevant Code:
IEnumerator LoadID()
{
print("Load ID");
var task = GetUserReference().Child("logs").GetValueAsync();
print("catch the data from base");
yield return new WaitUntil(() => task.IsCompleted);
print("wait for end of coroutine");
if (task.IsFaulted || task.IsCanceled)
{
print(task.Exception);
yield break;
}
DataSnapshot snapshot = task.Result;
print("retuen result: " + snapshot);
if (snapshot.Value != null)
{
print("load player data");
LoadJson(snapshot);
StartCoroutine(LoadCats());
StartCoroutine(LoadBuilds());
}
else
{
//SaveID();
print("no data");
SaveJson_F();
//authManager.validateSignIn(true);
}
}
- Dominant language
- C#
- Stars
- 922
- Forks
- 454
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from firebase/quickstart-unity
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
firebase/quickstart-unity#1448 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
firebase/quickstart-unity#1432 · 1 comment ·
-
new
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
firebase/quickstart-unity#1411 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
firebase/quickstart-unity#1403 · 1 comment ·
-
Firebase or specific Android versions trigger app_clear_data on first_open, disrupting our funnelOpennew
Difficulty 4/5 3-5 days Newbie friendliness 25/100
firebase/quickstart-unity#1390 · 1 comment ·
All issues in firebase/quickstart-unity
Similar issues
-
[Doc Gap] Document new --enable-public-network-access breaking change for azurebackup vault createOpencopilot documentation
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
area-dashboard
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
0 - Backlog Bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
BrighterCommand/Brighter#4539 ·
Maintainers usually reply within 1 day
-
area-networking
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dotnet/aspnetcore#69671 · 1 comment ·
Maintainers usually reply within 1 day
-
test
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NethermindEth/nethermind#14274 ·
Maintainers usually reply within 1 day