From d4d0503cc8dfe1964b24765378c9a49f31eb74c5 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Sat, 3 Feb 2024 22:47:30 -0300 Subject: [PATCH 1/2] ci: add Swift 5.8 job --- .github/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c72685a..08d536c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,17 @@ jobs: - name: Run Tests run: swift test + library-compatibility: + runs-on: ubuntu-latest + name: Test Library (Swift 5.8) + steps: + - uses: swift-actions/setup-swift@v1 + with: + swift-version: "5.8" + - uses: actions/checkout@v3 + - name: Run Tests + run: swift test + library-windows: runs-on: windows-latest name: Test Library (Windows) From 8a1008089c1ca8f087c4254d3d900d8732add5d9 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Sat, 3 Feb 2024 22:52:36 -0300 Subject: [PATCH 2/2] fix: swift 5.8 --- Sources/Realtime/V2/PostgresAction.swift | 8 ++++---- Sources/Realtime/V2/RealtimeChannelV2.swift | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Sources/Realtime/V2/PostgresAction.swift b/Sources/Realtime/V2/PostgresAction.swift index ecdf68d0..04e93e5d 100644 --- a/Sources/Realtime/V2/PostgresAction.swift +++ b/Sources/Realtime/V2/PostgresAction.swift @@ -75,10 +75,10 @@ public enum AnyAction: PostgresAction, HasRawMessage { var wrappedAction: any PostgresAction & HasRawMessage { switch self { - case let .insert(action): action - case let .update(action): action - case let .delete(action): action - case let .select(action): action + case let .insert(action): return action + case let .update(action): return action + case let .delete(action): return action + case let .select(action): return action } } diff --git a/Sources/Realtime/V2/RealtimeChannelV2.swift b/Sources/Realtime/V2/RealtimeChannelV2.swift index f7dc12dd..6fa34cd6 100644 --- a/Sources/Realtime/V2/RealtimeChannelV2.swift +++ b/Sources/Realtime/V2/RealtimeChannelV2.swift @@ -253,9 +253,10 @@ public actor RealtimeChannelV2 { let postgresActions = try data.decode(as: PostgresActionData.self) - let action: AnyAction = switch postgresActions.type { + let action: AnyAction + switch postgresActions.type { case "UPDATE": - .update( + action = .update( UpdateAction( columns: postgresActions.columns, commitTimestamp: postgresActions.commitTimestamp, @@ -266,7 +267,7 @@ public actor RealtimeChannelV2 { ) case "DELETE": - .delete( + action = .delete( DeleteAction( columns: postgresActions.columns, commitTimestamp: postgresActions.commitTimestamp, @@ -276,7 +277,7 @@ public actor RealtimeChannelV2 { ) case "INSERT": - .insert( + action = .insert( InsertAction( columns: postgresActions.columns, commitTimestamp: postgresActions.commitTimestamp, @@ -286,7 +287,7 @@ public actor RealtimeChannelV2 { ) case "SELECT": - .select( + action = .select( SelectAction( columns: postgresActions.columns, commitTimestamp: postgresActions.commitTimestamp,