Bring the call to referrerClient.installReferrer into a thread#1316
Closed
giawa wants to merge 2 commits intofacebook:mainfrom
Closed
Bring the call to referrerClient.installReferrer into a thread#1316giawa wants to merge 2 commits intofacebook:mainfrom
giawa wants to merge 2 commits intofacebook:mainfrom
Conversation
…t it can't block the main thread with slow binder calls. See facebook#1039 See facebook/facebook-sdk-for-unity#672 Also bring the cleanup of referrerClient into the try/catch in the thread. I believe this addresses an existing issue where if the call to referrerClient.installReferrer throws an exception then we never clean up the referrerClient.
Author
|
Just checking in to see if there's anything I can do to help with this PR. It would be great to get something like this in to help with ANR rates on Android. |
Author
|
@maxalbrightmeta Any chance you or someone on the team is able to take a look? |
Author
|
@rageandqq Any chance you're able to take a look at this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello Facebook!
To help us review the request, please complete the following:
bugfor bug fixes) (I don't seem to have permission to do this)Pull Request Details
We have an issue with high ANR rates on our Unity app, and the stack trace points to these two long standing open issues with this SDK:
I am not a Kotlin expert, but it seemed like this was a simple change to bring the call to
referrerClient.installReferrerover to a different thread.Warning
This change assumes it is okay to make the callback from a different thread than
tryConnectReferrerInfo. In my brief check of the codebase, this looked okay, but if necessary we may want to bring the callback back to the main thread.While doing this, I noticed that the try/catch for cleaning up the
referrerClientwouldn't work if an exception was thrown fromreferrerClient.installReferrer, so I moved that cleanup to a finally block instead.Test Plan
I have run the test app, but cannot test this code quite yet in my own app, as I haven't explored how to bring this over to Unity. I was hoping by starting here with this repository so I could get feedback before trying to get this brought in to the Unity package as well.
If there is something I can do to help test this, please let me know! My goal here is to get the ball rolling with this conversation so that we can address the high ANR rates caused by this SDK.