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) 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,