Skip to content

Swift 6 crash #881

@brzzdev

Description

@brzzdev

Describe the bug
I'm seeing an unexpected crash inside AppAuthCore when the module that calls into AppAuth is in Swift 6 mode.
Setting

swiftSettings: [
  .swiftLanguageMode(.v5),
]

makes the crash go away.

To Reproduce
Steps to reproduce the behavior:

let request = OIDAuthorizationRequest(
  configuration: config,
  clientId:clientId,
  scopes: nil,
  redirectURL: URL(string: redirectUri)!,
  responseType: OIDResponseTypeCode,
  additionalParameters: nil
)
OIDAuthState.authState(
  byPresenting: request,
  presenting: NSApp.keyWindow ?? NSWindow()
) { authState, error in ... }

then dismiss Safari and get an EXC_BREAKPOINT crash on the line callback(nil, authorizationError); in OIDAuthState.m

Expected behavior
The Swift 5 behaviour: The same library line is still hit, but no crash occurs

Environment

  • Device: [ MacBook Pro ]
  • OS: [ macOS 15.0 ]
  • Browser: [ Safari ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtriageIssues that need to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions