Skip to content

Commit 42f9fa0

Browse files
cleanup
1 parent 798c533 commit 42f9fa0

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

Sources/PowerSync/Kotlin/PowerSyncBackendConnectorAdapter.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
import OSLog
22

3-
internal class PowerSyncBackendConnectorAdapter: KotlinPowerSyncBackendConnector {
3+
class PowerSyncBackendConnectorAdapter: KotlinPowerSyncBackendConnector {
44
let swiftBackendConnector: PowerSyncBackendConnector
55
let db: any PowerSyncDatabaseProtocol
66
let logTag = "PowerSyncBackendConnector"
7-
7+
88
init(
99
swiftBackendConnector: PowerSyncBackendConnector,
1010
db: any PowerSyncDatabaseProtocol
1111
) {
1212
self.swiftBackendConnector = swiftBackendConnector
1313
self.db = db
1414
}
15-
15+
1616
override func __fetchCredentials() async throws -> KotlinPowerSyncCredentials? {
1717
do {
1818
let result = try await swiftBackendConnector.fetchCredentials()
1919
return result?.kotlinCredentials
2020
} catch {
2121
db.logger.error("Error while fetching credentials", tag: logTag)
22-
/// We can't use throwKotlinPowerSyncError here since the Kotlin connector
22+
/// We can't use throwKotlinPowerSyncError here since the Kotlin connector
2323
/// runs this in a Job - this seems to break the SKIEE error propagation.
2424
/// returning nil here should still cause a retry
2525
return nil
@@ -35,7 +35,7 @@ internal class PowerSyncBackendConnectorAdapter: KotlinPowerSyncBackendConnector
3535
// Relay the error to the Kotlin SDK
3636
try throwKotlinPowerSyncError(
3737
message: "Connector errored while uploading data: \(error.localizedDescription)",
38-
cause: error.localizedDescription,
38+
cause: error.localizedDescription
3939
)
4040
}
4141
}

Tests/PowerSyncTests/AttachmentTests.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ public func waitForMatch<T, E: Error>(
208208
}
209209
}
210210

211-
internal func waitFor(
211+
func waitFor(
212212
timeout: TimeInterval = 0.5,
213213
interval: TimeInterval = 0.1,
214-
predicate: () async throws -> Void,
214+
predicate: () async throws -> Void
215215
) async throws {
216216
let intervalNanoseconds = UInt64(interval * 1_000_000_000)
217217

@@ -221,14 +221,14 @@ internal func waitFor(
221221

222222
var lastError: Error?
223223

224-
while (Date() < timeoutDate) {
225-
do {
226-
try await predicate()
227-
return
228-
} catch {
224+
while Date() < timeoutDate {
225+
do {
226+
try await predicate()
227+
return
228+
} catch {
229229
lastError = error
230-
}
231-
try await Task.sleep(nanoseconds: intervalNanoseconds)
230+
}
231+
try await Task.sleep(nanoseconds: intervalNanoseconds)
232232
}
233233

234234
throw WaitForMatchError.timeout(

0 commit comments

Comments
 (0)