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

Added MainActor annotation for matches UIApplication.beginBackgroundTask(expirationHandler:) #1896

Closed
wants to merge 1 commit into from

Conversation

yochidros
Copy link

@yochidros yochidros commented Jun 12, 2024

What and why?

This fix addresses a build error in Xcode 16. The error occurs when building my app and the message is:

Type 'UIApplication' does not conform to protocol 'UIKitAppBackgroundTaskCoordinator'

The error logs provide more details:

UIKit.UIApplication:70:27: note: candidate has non-matching type '((@MainActor () -> Void)?) -> UIBackgroundTaskIdentifier'

nonisolated open func beginBackgroundTask(expirationHandler handler: (@MainActor () -> Void)? = nil) -> UIBackgroundTaskIdentifier

It seems that type checking has become more strict in Xcode 16 and Swift 6.0.

fix issue #1892

How?

just added annotation MainActor into expirationHander in UIKitAppBackgroundTaskCoordinator.beginBackgroundTask(expirationHandler:)

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes

Custom CI job configuration (optional)

  • Run unit tests for Core, RUM, Trace, Logs, CR and WVT
  • Run unit tests for Session Replay
  • Run integration tests
  • Run smoke tests
  • Run tests for tools/

@yochidros yochidros requested review from a team as code owners June 12, 2024 04:20
@maciejburda
Copy link
Member

We decided to follow this approach: #1898

But thank you for suggesting the change! 🙇

@yochidros yochidros deleted the xcode16 branch June 12, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants