Skip to content

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

Merged
merged 4 commits into from
Mar 4, 2022

Conversation

AlmostMatt
Copy link
Contributor

Description

Provide details of the change, and generalize the change in the PR title above.

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

Describe how you've tested these changes. Link any manually triggered Integration tests or CPP binary SDK Packaging Github Action workflows, if applicable.

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:

  • Bug fix. Add the issue # below if applicable.
  • New feature. A non-breaking change which adds functionality.
  • Other, such as a build process or documentation change.

This is a minor change in order to enable a new feature in the future.


Notes

  • Bug fixes and feature changes require an update to the Release Notes section of release_build_files/readme.md.
  • Read the contribution guidelines CONTRIBUTING.md.
  • Changes to the public API require an internal API review. If you'd like to help us make Firebase APIs better, please propose your change in a feature request so that we can discuss it together.

@AlmostMatt AlmostMatt requested a review from chkuang-g February 17, 2022 18:20
@AlmostMatt AlmostMatt added the skip-release-notes Skip release notes check label Feb 17, 2022
@@ -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();
Copy link
Contributor

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() {

Copy link
Contributor

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

Copy link
Contributor Author

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.

@AlmostMatt AlmostMatt merged commit 1a27900 into main Mar 4, 2022
@github-actions github-actions bot added the tests: in-progress This PR's integration tests are in progress. label Mar 4, 2022
@github-actions
Copy link

github-actions bot commented Mar 4, 2022

❌  Integration test FAILED

Requested by @AlmostMatt on commit 1a27900
Last updated: Fri Mar 4 12:05 PST 2022
View integration test log & download artifacts

Failures Configs
missing_log [BUILD] [ERROR] [tvOS] [macos]
[TEST] [ERROR] [tvOS] [macos] [tvos_simulator]

Add flaky tests to go/fpl-cpp-flake-tracker

@github-actions github-actions bot added the tests: failed This PR's integration tests failed. label Mar 4, 2022
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Mar 4, 2022
@firebase firebase locked and limited conversation to collaborators Apr 4, 2022
@AlmostMatt AlmostMatt deleted the heartbeat-logging-passthrough2 branch October 20, 2022 21:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
skip-release-notes Skip release notes check tests: failed This PR's integration tests failed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants