Skip to content

Firebase Realtime Database query is very slow on MAC OS 10.x #50

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

Open
thienphuoc opened this issue Apr 14, 2020 · 11 comments
Open

Firebase Realtime Database query is very slow on MAC OS 10.x #50

thienphuoc opened this issue Apr 14, 2020 · 11 comments

Comments

@thienphuoc
Copy link

thienphuoc commented Apr 14, 2020

Please fill in the following fields:

Pre-built SDK from the website or open-source from this repo:
Firebase C++ SDK version: 6.12.0
Firebase plugins in use (Auth, Database, etc.): Auth, Realtime
Additional SDKs you are using (Facebook, AdMob, etc.): �Facebook
Platform you are using the C++ SDK on (Mac, Windows, or Linux): MAC
Platform you are targeting (iOS, Android, and/or desktop): MAC OS

Please describe the issue here:

Hi firebase team!

Currently, I'm querying the data on the MAC OS platform. I'm facing the problem as follows :

The query takes a long time (1 to 3 minutes) to return a response. So This affects the user experience of my app.

On the IOS, Android and Windows platforms all work very well. I only have this problem on MAC OS.

I also tested both link options x86_64 and universal. But this also could not help me solve this problem.

Here is the information regarding my project :

Xcode: 11.3.1

Firebase_cpp_sdk: [ as above ]

My query : ( same as on the IOS, Android and Windows platforms)

auto user = ap::Database::getInstance().getUserInfo();

firebase::database::DatabaseReference dbref = database->GetReference();

std::string path = cocos2d::StringUtils::format("users/%d/%s/", user._id, USER_REALTIME_VARIABLE);

auto result = dbref.Child(path).GetValue();

result.OnCompletion([callback](const Future<firebase::database::DataSnapshot>& result_data) {

	//my codes

});

As I know, MACOS doesn't officially support from firebase team, right?
Could the firebase team help me solve this issue?
Hopefully, I can get answers soon from your side.

Please answer the following, if applicable:

Have you been able to reproduce this issue with just the Firebase C++ quickstarts? No, I have not tried.
What's the issue repro rate? 100%

@thienphuoc thienphuoc added the new New issue. label Apr 14, 2020
@google-oss-bot
Copy link

This issue does not seem to follow the issue template. Make sure you provide all the required information.

@morganchen12
Copy link

@thienphuoc, can you share a sample project that reproduces this issue?

@morganchen12 morganchen12 added api: database and removed new New issue. labels Apr 14, 2020
@dtnam1997
Copy link

dtnam1997 commented Apr 18, 2020

This problem only occurs when I add the app sandbox in the signning & capacities tab even though all permissions are enabled. After remove it all work very well. But to distribute a macOS app through the Mac App Store, you must enable the App Sandbox capability.
Could the firebase team help me solve this issue?
Hopefully, I can get answers soon from your side.
image

@thienphuoc
Copy link
Author

Hi @morganchen12

@dtnam1997 is my team member. It's the problem that my team is facing. Please let me know if you have any information to help us to solve this issue.

Thanks

@morganchen12
Copy link

Can you pause execution with the debugger while the SDK is waiting for a response and share the full stack trace at that time?

@thienphuoc
Copy link
Author

thienphuoc commented Apr 21, 2020

hi @morganchen12

Here is the sample project. https://github.com/thienphuoc/firebase_on_mac

The project path is located at

proj.ios_mac/TestFirebase.xcworkspace

If you want to reproduce bug , please take a look at the "Signing & Capabilities" tab. If we

  • remove the "App Sanbox" , all codes work correctly -> the helloword.png image will appear immediately in the center of the screen.

  • add the "App Sanbox" -> The query takes a long time to a respond (1 to 3 minutes) . You can see the code in HelloWord.cpp file.

Thanks

@morganchen12 morganchen12 self-assigned this Apr 21, 2020
@thienphuoc
Copy link
Author

@hi @morganchen12

Do you have any update on this issuse ?

@morganchen12
Copy link

Hey, sorry for the slow update. I will take a look at this today or tomorrow.

@morganchen12
Copy link

I was able to reproduce the error with the sample attached. This looks like a real bug, though I'm unable to determine what's causing it. It seems fetch return is much slower with sandbox enabled for both successful fetches and error cases, even on a fast wifi connection.

Next steps are to figure out if this is an issue when using the macOS SDK directly, and if so, try to further isolate it from there.

@dtnam1997
Copy link

Please tell us when you have updates on this issue ?

@jonsimantov
Copy link
Contributor

Since this appears to be an issue with the Firebase C++ SDK, I'm looking into whether App Sandboxing might be preventing RTDB on desktop from working properly.

Note however that Firebase C++ desktop support is in beta and is not intended for use in shipping desktop apps, and is meant to help streamline your development workflows. See here for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants