-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
FetchAndActivate is asynchronously executed? #5897
Comments
I found a few problems with this issue:
|
Hi @shuniiiig - thanks for the report. You're right, looks like the completion handler is called on the Remote Config queue instead of the main queue:
We'll have to discuss the appropriate approach moving forward and it may not be able to change until the next major version since some developers may be relying on this behaviour explicitly, but we'll chat about it on the team. Thanks for the report! |
Adding to Firebase 7 milestone to consider for next major release. |
Follow up for this: for Firebase 7 we should make sure that all completion handlers are called on the main thread for RC. |
@karenyz that looks like it's a different code path. I was able to verify that the completion handler isn't called on the main thread by putting a breakpoint here:
and running that unit test (see attached screenshot). By wrapping this call
|
[REQUIRED] Step 1: Describe your environment
FirebaseAnalyticsBinary 6.27.0
FirebaseDatabaseBinary 6.27.0
FirebaseDynamicLinksBinary 6.27.0
FirebaseMessagingBinary 6.27.0
FirebaseProtobufBinary 6.27.0
FirebaseRemoteConfigBinary 6.27.0
[REQUIRED] Step 2: Describe the problem
I called "fetchAndActivateWithCompletionHandler" in AppDelegate, after callback, I tried to present ViewController from root in AppDelegate, I got this error below.
[Animation] +[UIView setAnimationsEnabled:] being called from a background thread. Performing any operation from a background thread on UIView or a subclass is not supported and may result in unexpected and insidious behavior. trace=(
0 UIKitCore 0x00000001a54670d4 BD57BD6E-12B4-3F92-85CA-754932DA499D + 15552724
1 libdispatch.dylib 0x000000010b4fb730 dispatch_client_callout + 16
2 libdispatch.dylib 0x000000010b4fd044 dispatch_once_callout + 84
3 UIKitCore 0x00000001a5467038 BD57BD6E-12B4-3F92-85CA-754932DA499D + 15552568
4 UIKitCore 0x00000001a54671c0 BD57BD6E-12B4-3F92-85CA-754932DA499D + 15552960
5 UIKitCore 0x00000001a498f9c4 BD57BD6E-12B4-3F92-85CA-754932DA499D + 4184516
6 UIKitCore 0x00000001a498fe64 BD57BD6E-12B4-3F92-85CA-754932DA499D + 4185700
7 UIKitCore 0x00000001a498f8ac BD57BD6E-12B4-3F92-85CA-754932DA499D + 4184236
8 UIKitCore 0x00000001a498fb18 BD57BD6E-12B4-3F92-85CA-754932DA499D + 4184856
9 cast beta 0x0000000101232bbc $s4cast11AppDelegateC23setupRootViewController33_8F4EC175BF072ACA9581F0048C6E0225LLyyF + 1668
10 cast beta 0x0000000101231d54 $s4cast11AppDelegateC22latestVersionInstalled33_8F4EC175BF072ACA9581F0048C6E0225LLyyF + 60
11 cast beta 0x0000000101232130 $s4cast11AppDelegateC08checkNewB33VersionAndSetUpRootViewController33_8F4EC175BF072ACA9581F0048C6E0225LLyyFyAA20FirebaseRemoteConfigC13ConfigurationVSgcfU + 972
12 cast beta 0x00000001026879e8 $s4cast20FirebaseRemoteConfigC5fetch6resultyyAC13ConfigurationVSgc_tFZySo09FIRRemoteD22FetchAndActivateStatusV_s5Error_pSgtcfU + 1724
13 cast beta 0x0000000102687b48 $sSo37FIRRemoteConfigFetchAndActivateStatusVs5Error_pSgIegyg_ABSo7NSErrorCSgIeyByy_TR + 136
14 libdispatch.dylib 0x000000010b4fa338 _dispatch_call_block_and_release + 24
15 libdispatch.dylib 0x000000010b4fb730 _dispatch_client_callout + 16
16 libdispatch.dylib 0x000000010b4fde88 _dispatch_queue_override_invoke + 872
17 libdispatch.dylib 0x000000010b50cd74 _dispatch_root_queue_drain + 376
18 libdispatch.dylib 0x000000010b50d698 _dispatch_worker_thread2 + 152
19 libsystem_pthread.dylib 0x00000001a0c30b38 _pthread_wqthread + 212
20 libsystem_pthread.dylib 0x00000001a0c33740 start_wqthread + 8
)
DispatchQueue.main.async {
rootViewController.present(appTitleVC, animated: true)
}
To avoid this error, I wrote the code above.
I would like to ask remoteConfig.fetchAndActivate is changed to asynchronous?
Thank you.
The text was updated successfully, but these errors were encountered: