openid / openid/AppAuth-iOS

Swift 6 crash

Open
#881 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug triage
Dominant language
Objective-C
Stars
2k
Forks
867
Avg merge
4d 48m
Merged PRs (30d)
1

Description

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 ]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the authorization flow in Swift 6 mode on macOS 15, then inspect the callback at callback(nil, authorizationError) in OIDAuthState.m. Compare the behavior with Swift 5 mode and determine what change prevents the EXC_BREAKPOINT while preserving the existing authorization error callback behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, objective-c, swift
Domain
desktop-dev, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.