Skip to content
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

Hang Risk warning on configure call #13081

Open
tristan-warner-smith opened this issue Jun 6, 2024 · 7 comments
Open

Hang Risk warning on configure call #13081

tristan-warner-smith opened this issue Jun 6, 2024 · 7 comments
Assignees

Comments

@tristan-warner-smith
Copy link

tristan-warner-smith commented Jun 6, 2024

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.
image

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!
@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@paulb777
Copy link
Member

paulb777 commented Jun 6, 2024

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

@tristan-warner-smith
Copy link
Author

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.

@paulb777
Copy link
Member

@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.

@tristan-warner-smith
Copy link
Author

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)
        }
    }

@paulb777
Copy link
Member

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)
    }

@tristan-warner-smith
Copy link
Author

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)
                }
            })
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants