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

Add @unchecked Sendable to Todo #130

Merged
merged 1 commit into from
Apr 29, 2024
Merged

Add @unchecked Sendable to Todo #130

merged 1 commit into from
Apr 29, 2024

Conversation

dannflor
Copy link
Contributor

@dannflor dannflor commented Apr 29, 2024

As per vapor/vapor#3180 and vapor/fluent-kit#601, the recent update to Fluent to add (nearly but not totally complete) Sendable-correctness results in a new warning of the form Stored property '_id' of 'Sendable'-conforming class 'Todo' is mutable for all types conforming to Fields, Schema, and/or Model. This adds the appropriate annotation to the template's Todo model for sample purposes.
(@gwynne wrote this)

/// Property wrappers interact poorly with `Sendable` checking, causing a warning for the `@ID` property
/// It is recommended you write your model with sendability checking on and then suppress the warning
/// afterwards with `@unchecked Sendable`.
final class Todo: Model, Content, @unchecked Sendable {
static let schema = "todos"
Copy link
Contributor

Choose a reason for hiding this comment

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

This one's better with the conment (compared to @gwynne's).

@gwynne gwynne merged commit 3e6e600 into main Apr 29, 2024
11 checks passed
@gwynne gwynne deleted the unchecked-model branch April 29, 2024 22:21
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.

3 participants