Skip to content
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

Add null checks in Messaging task completions #1602

Merged
merged 4 commits into from
Jun 7, 2024

Conversation

a-maurice
Copy link
Contributor

Description

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

Add some null checks in the Android Task completion callbacks that finish Futures. Based on the callstack from firebase/firebase-unity-sdk#1030, my guess is while there is a pending Android task, Messaging is getting cleaned up, and then when the Android task completes it does the callback, but the Future has been deleted.


Testing

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


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.

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.

@a-maurice a-maurice added the tests-requested: quick Trigger a quick set of integration tests. label Jun 5, 2024
@a-maurice a-maurice requested a review from jonsimantov June 5, 2024 19:17
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. and removed tests-requested: quick Trigger a quick set of integration tests. labels Jun 5, 2024
Copy link

github-actions bot commented Jun 5, 2024

✅  Integration test succeeded!

Requested by @a-maurice on commit 3cbccb4
Last updated: Thu Jun 6 19:03 PDT 2024
View integration test log & download artifacts

@a-maurice a-maurice added the skip-release-notes Skip release notes check label Jun 5, 2024
@github-actions github-actions bot added the tests: succeeded This PR's integration tests succeeded. label Jun 5, 2024
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Jun 5, 2024
@@ -843,8 +847,12 @@ static void CompleteStringCallback(JNIEnv* env, jobject result,
SafeFutureHandle<std::string>* handle =
reinterpret_cast<SafeFutureHandle<std::string>*>(callback_data);
Error error = success ? kErrorNone : kErrorUnknown;
ReferenceCountedFutureImpl* api = FutureData::Get()->api();
api->CompleteWithResult(*handle, error, status_message, result_value);
if (FutureData::Get() && FutureData::Get()->api()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need a mutex lock?

@a-maurice a-maurice added tests-requested: quick Trigger a quick set of integration tests. and removed tests: succeeded This PR's integration tests succeeded. skip-release-notes Skip release notes check labels Jun 6, 2024
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. tests: failed This PR's integration tests failed. and removed tests-requested: quick Trigger a quick set of integration tests. labels Jun 6, 2024
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Jun 6, 2024
@a-maurice a-maurice added tests-requested: quick Trigger a quick set of integration tests. and removed tests: failed This PR's integration tests failed. labels Jun 6, 2024
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. tests: succeeded This PR's integration tests succeeded. and removed tests-requested: quick Trigger a quick set of integration tests. labels Jun 6, 2024
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Jun 6, 2024
@a-maurice a-maurice enabled auto-merge (squash) June 7, 2024 00:41
@a-maurice a-maurice merged commit 3cbccb4 into main Jun 7, 2024
30 checks passed
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. and removed tests: succeeded This PR's integration tests succeeded. labels Jun 7, 2024
@github-actions github-actions bot added the tests: succeeded This PR's integration tests succeeded. label Jun 7, 2024
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Jun 7, 2024
@firebase firebase locked and limited conversation to collaborators Jul 9, 2024
@a-maurice a-maurice deleted the am-messaging_null_checks branch October 1, 2024 22:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tests: succeeded This PR's integration tests succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants