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

Remove access to application launch options via @Application on macOS #100

Merged
merged 4 commits into from
Feb 24, 2024

Conversation

philippzagar
Copy link
Member

@philippzagar philippzagar commented Feb 24, 2024

Remove access to application launch options via @Application on macOS

♻️ Current situation & Problem

The current version of Spezi crashes when using the ApplicationDelegateAdaptor with the .spezi() view modifier on macOS platforms. This results from a broken assumption about the initialization order upon Spezi bootup on macOS (not Catalyst!): The .spezi() view modifier is evaluated (and therefore Spezi initialized) before SpeziAppDelegate/applicationWillFinishLaunching() is called.
This currently leads to a precondition failure on macOS within SpeziAppDelegate/applicationWillFinishLaunching() as Spezi is already initialized.

Background: We initialize Spezi on macOS within the SpeziAppDelegate/applicationWillFinishLaunching() so that the application launch options are accessible via @Application (@Application(\.launchOptions)).

We noticed that error when lifting the SpeziSpeech module to visionOS & macOS: StanfordSpezi/SpeziSpeech#5

⚙️ Release Notes

  • Remove access to application launch options via @Application on macOS, fixing a crash upon Spezi initialization

📚 Documentation

Adjusted documentation in line about not supporting launch options on macOS anymore

✅ Testing

Manual testing

📝 Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@philippzagar philippzagar added the bug Something isn't working label Feb 24, 2024
@philippzagar philippzagar self-assigned this Feb 24, 2024
@philippzagar philippzagar changed the title Remove access to application launch options on macOS Remove access to application launch options via @Application on macOS Feb 24, 2024
Copy link
Member

@Supereg Supereg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing this so quickly.

@philippzagar philippzagar enabled auto-merge (squash) February 24, 2024 02:01
Copy link

codecov bot commented Feb 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.95%. Comparing base (c8482d0) to head (9ea0840).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #100      +/-   ##
==========================================
+ Coverage   84.78%   84.95%   +0.18%     
==========================================
  Files          40       40              
  Lines         959      950       -9     
==========================================
- Hits          813      807       -6     
+ Misses        146      143       -3     
Files Coverage Δ
...pezi/Spezi/KnowledgeSources/LaunchOptionsKey.swift 100.00% <ø> (+33.34%) ⬆️
Sources/Spezi/Spezi/Spezi+Preview.swift 96.16% <ø> (ø)
Sources/Spezi/Spezi/SpeziAppDelegate.swift 90.91% <ø> (-0.47%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c8482d0...9ea0840. Read the comment docs.

@philippzagar philippzagar enabled auto-merge (squash) February 24, 2024 02:17
Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @philippzagar 👍

@philippzagar philippzagar merged commit 0ced3ef into main Feb 24, 2024
12 checks passed
@philippzagar philippzagar deleted the feat/launch-options-macos branch February 24, 2024 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants