Skip to content

Commit

Permalink
Add verbose logging when subsriptions enabled, watchOS simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
lawmicha committed Nov 23, 2023
1 parent fdeab13 commit ea2ed4b
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ final class AWSIncomingEventReconciliationQueue: IncomingEventReconciliationQueu
self.connectionStatusSerialQueue
= DispatchQueue(label: "com.amazonaws.DataStore.AWSIncomingEventReconciliationQueue")

let subscriptionsDisabled = disableSubscriptions()

#if targetEnvironment(simulator) && os(watchOS)
if !subscriptionsDisabled {
let message = """
DataStore uses subscriptions via websockets, which work on the watchOS simulator but not on the device.
Running DataStore on watchOS with subscriptions enabled is only possible during special circumstances
such as actively streaming audio. See https://github.com/aws-amplify/amplify-swift/pull/3368 for more details.
"""
self.log.verbose(message)
}
#endif

for modelSchema in modelSchemas {
let modelName = modelSchema.name
let syncExpression = syncExpressions.first(where: {
Expand All @@ -88,7 +101,7 @@ final class AWSIncomingEventReconciliationQueue: IncomingEventReconciliationQueu
modelPredicate,
auth,
authModeStrategy,
disableSubscriptions() ? OperationDisabledIncomingSubscriptionEventPublisher() : nil)
subscriptionsDisabled ? OperationDisabledIncomingSubscriptionEventPublisher() : nil)

reconciliationQueues.with { reconciliationQueues in
reconciliationQueues[modelName] = queue
Expand Down

0 comments on commit ea2ed4b

Please sign in to comment.