1.50.4 - Partial fix for nested keypaths through `@CompositeOptionalParent` properties
LatestWhat's Changed
Partial fix for nested keypaths through @CompositeOptionalParent
properties by @gwynne in #632
As with
@CompositeParent
, keypaths through@CompositeOptionalParent
can refer to properties of the target model’s compositeIDValue
. However, thesubscript(dynamicMember:)
accessor of@CompositeOptionalParent
which enables this functionality returns an optional value, and the result is alwaysnil
if the relation has not been loaded.This was caused by an oversight during the original implementation of the composite relation properties: The accessor should not be returning an optional value, nor should the result ever be
nil
regardless of whether or not the relation is loaded. We can’t fix the fact that it returns an optional without breaking public API, so callers still have to add a!
in the nested keypaths. But we can at least make the accessor useful by fixing it to never returnnil
, which is what this PR does. A test is also included.Also updates the CI while we’re at it.
final class ParentModel: Model, @unchecked Sendable { final class IDValue: Fields, @unc……
This patch was released by @gwynne
Full Changelog: 1.50.3...1.50.4