Skip to content

Firebase realtime database doesn't load the query result nor call onCancelled method. #2604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bolds07 opened this issue Apr 21, 2021 · 3 comments

Comments

@bolds07
Copy link

bolds07 commented Apr 21, 2021

[READ] Step 1: Are you in the right place?

YES

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 4.1.1
  • Firebase Component: database
  • Component version: 19.7.0

[REQUIRED] Step 3: Describe the problem

Firebase realtime database doesn't load the query result nor call onCancelled method.

For the past month I've been facing a problem with database queries that seems to take forever to load.
In the production version of my app, thanks to crashylicts and firabase events i was able to detect that some sessions are not able to complete the query neither return any exception or error... the request simple "vanishes"

Since feb/march I started getting lots of complaints in google play that users were facing a "extremly long login time" and since i didnt change anything in the apps logic related to that i started monitore and look for errors

The average login time to the app is 6 seconds with 90% of the sessions being bellow 10 seconds... (ignoring the time user takes to fill the login form)
But some users would wait over 1 minute and the login wouldn't finish... these users would often get bored and close the app or try to clean data or reinstall

From what i debugged the dead end was the firebase query to the user profile.... very simple query using a previous known userid and obtaining a few persistent data from user [8 fields between strings and long... no nested data]

I wasn't able to reproduce the problem in Dev but since the app has 20k daily users it happens quite often in the production env, also I didn't take note the exact date the problem started but it was last month [probably some update i made of the firebase api]

Then today looking for info i got to find this issue firebase/firebase-admin-node#1231 which thanks @hiranya911 and other guys was possible to determine there was a tight loop condition in the firebase admin sdk when refresh the auth token for the realtime database

i wonder if it is possible that something similar is happening here... and if not is there anything i can do to debug futher?
I know exactly which query and which uid triggers the condition, but as i said it is a random condition in which if the same user tries a few minutes later works fine

Relevant Code:

 FirebaseDatabase.getInstance().getReference("any/node").addListenerForSingleValueEvent(new ValueEventListener() {
                @Override
                public void onDataChange(@NonNull DataSnapshot snapshot) {
                    //not called                    
                }

                @Override
                public void onCancelled(@NonNull DatabaseError error) {
                    //neither
                }
            });
@aguatno
Copy link

aguatno commented May 19, 2021

Hi @bolds07 I'm sorry you experience the issue. We cannot seem to reproduce it on our end and do believe this hasn't been reported elsewhere. What percentage of your users are experiencing this? I know it's hard to reproduce this issue on your end, but if you could share a project in GitHub that I could clone to reproduce, that would be extremely helpful to us. I'd like to make sure I'm using the same setup as your environment.

@google-oss-bot
Copy link
Contributor

Hey @bolds07. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link
Contributor

Since there haven't been any recent updates here, I am going to close this issue.

@bolds07 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@firebase firebase locked and limited conversation to collaborators Jul 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants