Skip to content

Make HTTPSCallableResult Sendable to fix Swift 6 bridge data-race error#93

Closed
IT-Guy007 wants to merge 1 commit into
skiptools:mainfrom
IT-Guy007:fix/functions-result-sendable
Closed

Make HTTPSCallableResult Sendable to fix Swift 6 bridge data-race error#93
IT-Guy007 wants to merge 1 commit into
skiptools:mainfrom
IT-Guy007:fix/functions-result-sendable

Conversation

@IT-Guy007

Copy link
Copy Markdown
Contributor

Summary

Fixes #92.

Since 0.20.0 bumped swift-tools-version to 6.1, the package and its skipstone-generated *_Bridge.swift files compile in Swift 6 language mode, where strict-concurrency violations are hard errors. The generated SkipFirebaseFunctions bridge resumes its continuation with the call result:

SkipFirebaseFunctions_Bridge.swift:253:36: error: sending 'f_return' risks causing data races [#SendingRisksDataRace]
253 |                     f_continuation.resume(returning: f_return!)
    |                                    |- error: sending 'f_return' risks causing data races

resume(returning:) takes a sending parameter under Swift 6, but the re-exported FirebaseFunctions.HTTPSCallableResult is not Sendable, so passing it across the task-isolation boundary is rejected. This compiled fine under 0.19.0 (tools-version 5.9, where it was at most a warning).

Change

Add a retroactive @unchecked Sendable conformance for HTTPSCallableResult, mirroring the exact pattern 0.20.0 already applied to Firestore, CollectionReference and Messaging — Functions was simply missed.

extension HTTPSCallableResult: @retroactive @unchecked Sendable {}

Verification

swift build --target SkipFirebaseFunctions (Darwin) compiles clean; the generated functions bridge no longer raises #SendingRisksDataRace.

The swift-tools-version bump to 6.1 in 0.20.0 puts the package and its
skipstone-generated *_Bridge.swift files into Swift 6 language mode, where
strict-concurrency violations are errors. The generated SkipFirebaseFunctions
bridge resumes a continuation with an HTTPSCallableResult via the 'sending'
resume(returning:) parameter, but the re-exported FirebaseFunctions
HTTPSCallableResult is not Sendable, triggering #SendingRisksDataRace.

Add a retroactive @unchecked Sendable conformance, mirroring the same fix
0.20.0 already applied to Firestore, CollectionReference and Messaging.

Fixes skiptools#92
@IT-Guy007

Copy link
Copy Markdown
Contributor Author

@marcprux please approve and create version 0.20.1

@marcprux

Copy link
Copy Markdown
Member

@marcprux please approve and create version 0.20.1

I followed-up at #92 (comment)

@IT-Guy007

Copy link
Copy Markdown
Contributor Author

@marcprux the issue has been fixed with the latest skip version, up to you if you still want to merge this pr. Functions does miss extension HTTPSCallableResult: @retroactive @unchecked Sendable {} compared to the others.

@IT-Guy007 IT-Guy007 closed this Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skip-Firebase 0.20.0 causes data racing issues

2 participants