Skip to content

Commit 05c01ab

Browse files
committed
Fix build and lint errors after rebase
enable-different-request-for-frc-in-subscriptions
1 parent 5b50e79 commit 05c01ab

2 files changed

Lines changed: 28 additions & 4 deletions

File tree

Sources/CoreDataRepository/Internal/AggregateSubscription.swift

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ final class AggregateSubscription<Value: Numeric & Sendable>: Subscription<Value
4040
}
4141

4242
@usableFromInline
43-
// swiftlint:disable:next function_body_length
4443
convenience init(
4544
function: CoreDataRepository.AggregateFunction,
4645
context: NSManagedObjectContext,
@@ -132,7 +131,20 @@ final class AggregateSubscription<Value: Numeric & Sendable>: Subscription<Value
132131
context: context,
133132
continuation: continuation
134133
)
135-
fail(.propertyDoesNotMatchEntity)
134+
guard let entityName = entityDesc.name ?? entityDesc.managedObjectClassName else {
135+
fail(.propertyDoesNotMatchEntity(description: nil))
136+
return
137+
}
138+
guard let attributeEntityName = attributeDesc.entity.name ?? attributeDesc.entity.managedObjectClassName
139+
else {
140+
fail(.propertyDoesNotMatchEntity(description: entityName))
141+
return
142+
}
143+
fail(
144+
.propertyDoesNotMatchEntity(
145+
description: "\(entityName) != \(attributeDesc.name).\(attributeEntityName)"
146+
)
147+
)
136148
return
137149
}
138150
self.init(

Sources/CoreDataRepository/Internal/AggregateThrowingSubscription.swift

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ final class AggregateThrowingSubscription<Value: Numeric & Sendable>: ThrowingSu
4444
}
4545

4646
@usableFromInline
47-
// swiftlint:disable:next function_body_length
4847
convenience init(
4948
function: CoreDataRepository.AggregateFunction,
5049
context: NSManagedObjectContext,
@@ -136,7 +135,20 @@ final class AggregateThrowingSubscription<Value: Numeric & Sendable>: ThrowingSu
136135
context: context,
137136
continuation: continuation
138137
)
139-
fail(.propertyDoesNotMatchEntity)
138+
guard let entityName = entityDesc.name ?? entityDesc.managedObjectClassName else {
139+
fail(.propertyDoesNotMatchEntity(description: nil))
140+
return
141+
}
142+
guard let attributeEntityName = attributeDesc.entity.name ?? attributeDesc.entity.managedObjectClassName
143+
else {
144+
fail(.propertyDoesNotMatchEntity(description: entityName))
145+
return
146+
}
147+
fail(
148+
.propertyDoesNotMatchEntity(
149+
description: "\(entityName) != \(attributeDesc.name).\(attributeEntityName)"
150+
)
151+
)
140152
return
141153
}
142154
self.init(

0 commit comments

Comments
 (0)