-
Notifications
You must be signed in to change notification settings - Fork 161
Open
Labels
Description
Describe the bug
Starting with 5.20.0 setIdentity method started using requestQueue_ + handleNewRequest which internally blocks caller's non-main thread. In my specific case it causes app startup to freeze for ~15 seconds.
Latest 5.20.3 has the same issue.
Steps to reproduce
- Call
Branch.getAutoInstance(context).setIdentity(userId)from a background thread - Thread is blocked until
setIdentitycompletes
Expected behavior
Thread is not blocked; Branch uses different internal thread pool to execute tasks
SDK Version
5.20.3
Make and Model
Emulator Pixel 9 Pro
OS
16.0
Additional Information/Context
Tested with this code:
Timber.tag("TestTest").d("Getting instance ${LocalTime.now()}")
val instance = Branch.getAutoInstance(context)
Timber.tag("TestTest").d("Setting identity ${LocalTime.now()}")
instance.setIdentity(it)
Timber.tag("TestTest").d("Identity set ${LocalTime.now()}")5.20.0 - 5.20.3:
Getting instance 12:59:53.960
Setting identity 12:59:53.960
Identity set 13:00:09.463
5.19.0:
Getting instance 13:00:39.611
Setting identity 13:00:39.611
Identity set 13:00:39.611
Reactions are currently unavailable