Skip to content

Change sendUnsentReports return type to async #4191

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

acntwww
Copy link

@acntwww acntwww commented Oct 10, 2022

Change FirebaseCrashlytics#sendUnsentReports return type to Task<Void>

With a Task type result returned, we can hold and wait the task to be finished if we want.

@google-cla
Copy link

google-cla bot commented Oct 10, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@thatfiredev
Copy link
Member

@acntwww I'm curious about your use-case. Why would you want to await on the result of this?

@acntwww
Copy link
Author

acntwww commented Oct 20, 2022

@thatfiredev I init the firebase sdk all by hand with other SDKs , saying sdk-a.

private void init() {
  initFirebase();
  initSdkA(); <--- this is where the crash happens
}

This crash may not be uploaded. So I try to upload the crash info in initFirebase function, like:

private void initFirebase() {
  ...
  Task<Void> unsentReports = firebaseCrashlytics.sendUnsentReports();
  Utils.awaitEvenIfOnMainThread(unsentReports);
  ...
}

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

Successfully merging this pull request may close these issues.

None yet

3 participants