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

Missing Sendable Conformance in Core Types (Field & Reference) Breaks Concurrent Usage #352

Closed
vamsii777 opened this issue Dec 1, 2024 · 0 comments
Assignees
Labels

Comments

@vamsii777
Copy link
Contributor

Describe the bug
Missing Sendable conformance in core MongoKitten types (Field and Reference) causing compiler errors when used in concurrent contexts. The generic types Field and Reference were marked as Sendable but didn't properly handle the Sendable requirements of their generic parameters.

To Reproduce

  1. Use MongoKitten in a project with strict concurrency checking enabled
  2. Create a model using @Field property wrapper with any Codable type
  3. Use Reference with any ReadableModel
  4. Compile the project
  5. Observe compiler errors about Sendable conformance
struct Project: Model, ResponseEncodable {
    @Field var _id: ObjectId
    @Field var organizationId: Reference<Organization>
    @Field var name: String
}

Expected behavior

  • Field should be Sendable only when its wrapped type C is Sendable
  • Reference should be Sendable when M.Identifier is Sendable
  • No compiler errors when used with Sendable-conforming types
  • Clear compiler errors when used with non-Sendable types

Environment:

  • OS: macOS 15.1.1 (24B91)
  • Swift Version: 6.0
  • MongoKitten Version: 7.9.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants