Bring the call to referrerClient.installReferrer into a thread #1372
+18
−14
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! I'm trying this PR again, which got closed as stale by your bot previously. @rageandqq any chance you can take a look?
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.