Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: drop old realtime client #460

Merged
merged 4 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading