-
Notifications
You must be signed in to change notification settings - Fork 123
Heartbeat logging passthrough for FIS for mobile platforms. #853
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
Conversation
@@ -186,6 +186,19 @@ void InstallationsInternal::Cleanup() { | |||
} | |||
} | |||
|
|||
void InstallationsInternal::LogHeartbeat(const firebase::App& app) { | |||
// Calling the native getter is sufficient to cause a Heartbeat to be logged. | |||
JNIEnv* env = app.GetJNIEnv(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious if there will be some warning and exception thrown out while running on android. If so, probably need to follow this pattern to make sure the jni exception is cleared.
Future<bool> RemoteConfigInternal::Activate() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. We probably should do the same for Auth as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a call to CheckAndClearJniExceptions.
I removed the FIREBASE_ASSERT since I had just copied it literally from the above InstallationsInternal, but I dont think we need such an assertion in the LogHeartbeat method since the installations instance is not actually used by LogHeartbeat.
I also checked the Auth change and confirmed that I do already call CheckAndClearJniExceptions in the Auth LogHeartbeat method.
https://github.com/firebase/firebase-cpp-sdk/pull/846/files
I find it a bit odd that there were not any existing calls to CheckAndClearJniExceptions in installations_android.cc, but maybe it is just because it was written longer ago.
❌ Integration test FAILEDRequested by @AlmostMatt on commit 1a27900
Add flaky tests to go/fpl-cpp-flake-tracker |
Description
Update c++ FIS GetInstance to always call native FIS getters so that any logging internal to the native implementations will be triggered.
This is as described in the "How data is collected" section of
https://docs.google.com/document/d/1eVlEmjdxSsXsvnzGiRYYfb0RtfWRLi3yo9vHj0NhqE4/edit#heading=h.ohspo4gdlkj0
This is effectively the same as #846, but for FIS
Testing
This is effectively no-op for now, since native SDKs do not yet log heartbeats.
Once heartbeat logging from getters is supported, manual testing will verify the process end to end.
Type of Change
Place an
x
the applicable box:This is a minor change in order to enable a new feature in the future.
Notes
Release Notes
section ofrelease_build_files/readme.md
.