Skip to content

Commit

Permalink
chore!: drop old realtime client (#460)
Browse files Browse the repository at this point in the history
* chore!: drop old realtime client

* fix after rebase

* wip

* change assertion
  • Loading branch information
grdsdev committed Jul 16, 2024
1 parent b8f8164 commit efcb12d
Show file tree
Hide file tree
Showing 36 changed files with 1,023 additions and 4,666 deletions.
8 changes: 4 additions & 4 deletions Examples/SlackClone/AppView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ final class AppViewModel {
var session: Session?
var selectedChannel: Channel?

var realtimeConnectionStatus: RealtimeClientV2.Status?
var realtimeConnectionStatus: RealtimeClient.Status?

init() {
Task { [weak self] in
for await (event, session) in await supabase.auth.authStateChanges {
for await (event, session) in supabase.auth.authStateChanges {
guard [.signedIn, .signedOut, .initialSession].contains(event) else { return }
self?.session = session

if session == nil {
for subscription in await supabase.realtimeV2.subscriptions.values {
for subscription in supabase.realtime.subscriptions.values {
await subscription.unsubscribe()
}
}
}
}

Task {
for await status in await supabase.realtimeV2.statusChange {
for await status in supabase.realtime.statusChange {
realtimeConnectionStatus = status
}
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/SlackClone/ChannelStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class ChannelStore {
Task {
channels = await fetchChannels()

let channel = await supabase.realtimeV2.channel("public:channels")
let channel = await supabase.realtime.channel("public:channels")

let insertions = await channel.postgresChange(InsertAction.self, table: "channels")
let deletions = await channel.postgresChange(DeleteAction.self, table: "channels")
Expand Down
2 changes: 1 addition & 1 deletion Examples/SlackClone/MessageStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ final class MessageStore {

private init() {
Task {
let channel = await supabase.realtimeV2.channel("public:messages")
let channel = await supabase.realtime.channel("public:messages")

let insertions = await channel.postgresChange(InsertAction.self, table: "messages")
let updates = await channel.postgresChange(UpdateAction.self, table: "messages")
Expand Down
2 changes: 1 addition & 1 deletion Examples/SlackClone/UserStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class UserStore {

private init() {
Task {
let channel = await supabase.realtimeV2.channel("public:users")
let channel = await supabase.realtime.channel("public:users")
let changes = await channel.postgresChange(AnyAction.self, table: "users")

let presences = await channel.presenceChange()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ final class CallbackManager: Sendable {
func triggerPresenceDiffs(
joins: [String: PresenceV2],
leaves: [String: PresenceV2],
rawMessage: RealtimeMessageV2
rawMessage: RealtimeMessage
) {
let presenceCallbacks = mutableState.callbacks.compactMap {
if case let .presence(callback) = $0 {
Expand Down
108 changes: 0 additions & 108 deletions Sources/Realtime/Defaults.swift

This file was deleted.

102 changes: 0 additions & 102 deletions Sources/Realtime/Delegated.swift

This file was deleted.

11 changes: 0 additions & 11 deletions Sources/Realtime/Deprecated.swift

This file was deleted.

Loading

0 comments on commit efcb12d

Please sign in to comment.