Skip to content

Initial app state not set for SwiftUI #6275

@noahsmartin

Description

@noahsmartin

Description

In SentryUIApplication we use the queue wrapper to dispatchAsync before setting application state. However, the queue wrapper will not actually dispatch async if it is called on the main queue. That means it is a no-op.

Since this code isn't dispatched async and instead gets executed right away, it ends up seeing a null UIApplication for SwiftUI apps. The attached screenshot shows how the application is null when we attempt to set the initial state. This issue existed prior to the refactoring in #5900 and still exists in the new swift code

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions