Skip to content

Commit 22a0cf0

Browse files
authored
fix(DataStore): watchOS subscription disabled configuration value (#3432)
1 parent 92ff97d commit 22a0cf0

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

AmplifyPlugins/DataStore/Sources/AWSDataStorePlugin/Configuration/DataStoreConfiguration+Helper.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ extension DataStoreConfiguration {
9090
/// enabled is only possible during special circumstances such as actively streaming audio.
9191
/// See https://github.com/aws-amplify/amplify-swift/pull/3368 for more details.
9292
public static var subscriptionsDisabled: DataStoreConfiguration {
93-
.custom(disableSubscriptions: { false })
93+
.custom(disableSubscriptions: { true })
9494
}
9595
#else
9696
/// The default configuration.

AmplifyPlugins/DataStore/Tests/AWSDataStorePluginTests/Core/DataStoreCategoryConfigurationTests.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ class AWSDataStorePluginConfigurationTests: XCTestCase {
1414
override func setUp() async throws {
1515
await Amplify.reset()
1616
}
17-
17+
18+
#if os(watchOS)
19+
func testSubscriptionDisabledTrue() throws {
20+
XCTAssertTrue(DataStoreConfiguration.subscriptionsDisabled.disableSubscriptions())
21+
}
22+
#endif
23+
1824
func testDoesNotThrowOnMissingConfig() throws {
1925
#if os(watchOS)
2026
let plugin = AWSDataStorePlugin(modelRegistration: TestModelRegistration(),
@@ -33,5 +39,5 @@ class AWSDataStorePluginConfigurationTests: XCTestCase {
3339
XCTFail("Should not throw even if not supplied with a plugin-specific config.")
3440
}
3541
}
36-
42+
3743
}

0 commit comments

Comments
 (0)