firebase-ios-sdk
firebase-ios-sdk copied to clipboard
Hang Risk warning on configure call
Description
We have a SwiftUI app and we're occasionally seeing these Hang Risk warnings.
We initialise Firebase in our app Initialiser.
struct OurApp: App {
init() {
FirebaseApp.configure()
}
}
The warning is:
Thread running at User-interactive quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class. Investigate ways to avoid priority inversions
Here's the stack trace.
Reproducing the issue
Create a SwiftUI app as above, configuring Firebase. Run the app in Xcode with the debugger attached. Sporadically, witness behaviour as described.
Firebase SDK Version
10.25
Xcode Version
15.4
Installation Method
Swift Package Manager
Firebase Product(s)
AB Testing, Analytics, Authentication, Crashlytics, DynamicLinks, Firestore, Functions, In-App Messaging, Performance, Remote Config, Storage
Targeted Platforms
iOS
Relevant Log Output
No response
If using Swift Package Manager, the project's Package.resolved
Expand Package.resolved snippet
Replace this line with the contents of your Package.resolved.
If using CocoaPods, the project's Podfile.lock
Expand Podfile.lock snippet
Replace this line with the contents of your Podfile.lock!
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
FirebaseDynamicLinks is deprecated and support will end in 2025.
We may not be able to address this and recommend that you transition the app away from Dynamic Links.
https://firebase.google.com/support/dynamic-links-faq
FirebaseDynamicLinks is deprecated and support will end in 2025.
We may not be able to address this and recommend that you transition the app away from Dynamic Links.
https://firebase.google.com/support/dynamic-links-faq
Hey Paul,
We use Dynamic Links purely for Firebase Authentication. The docs say "we will provide an update that will require a client- side update to ensure that email link auth continues working after the Firebase Dynamic Links service is shut down" but as far as I can see, this change has not been made yet.
@tristan-warner-smith It's true that the Firebase Auth Dynamic Links replacement is not yet available. However, Firebase Authentication only requires the Firebase Dynamics Links back end to be set up on the console. It does not need the SDK to be built into the app.
Firebase Auth isn't our only auth provider and we need to know for a given deeplink, whether it's been handled by Firebase Auth. We currently have the following for that, but if there's an alternative, that would be great.
func handle(url: URL, completion: ((URL?) -> Void)?) -> Bool {
DynamicLinks.dynamicLinks().handleUniversalLink(url) { dynamicLink, _ in
completion?(dynamicLink?.url)
}
}
Do you need the link processing that handleUniversalLink does? Versus directly calling the completion block?
func handle(url: URL, completion: ((URL?) -> Void)?) -> Bool {
completion?(url)
}
We do, this code could definitely use a refactor but this is internally wrapped in:
func parseFirebase(url: URL) async -> Deeplink? {
await withCheckedContinuation { continuation in
_ = dynamicLinks.handle(url: url, completion: { _ in
if let parsedDeeplink = Self.parseInternalNavigationDeeplink(from: url.relativePath) {
continuation.resume(returning: parsedDeeplink)
} else {
continuation.resume(returning: nil)
}
})
}
}
Closing, since the Dynamic Links SDK will be deleted this year