I have been having trouble with my appwrite realtime connection for a few days now. Before the code that was working fine now is giving failed to connect errors
this is the network tab
each socket name/header
messages
After the initial data has been fetched, This is the setup 'import { defineStore } from 'pinia'
export const useRealtime = defineStore('realtime', { state: () => ({ subscription: null, started: false }),
actions: {
async startWatch() {
if (this.started) return
const { realTime, Query } = useAppwrite()
const forNotifications = useNotifications()
// more stores here...
const forUserCreds = useUserCreds()
const forUserCredsId = computed(() => forUserCreds.mdV4UserId)
const config = useRuntimeConfig().public
const channels = [
`databases.${config.APPWRITE_DB_ID}.tables.${config.APPWRITE_USERNOTIFICATIONS_COLL}.rows`,
// more channels here...
]
this.subscription = await realTime.subscribe(channels, (res) => {
const row = res.payload
if (!row) return
const id = row.$id
const eventsVals = Object.values(res.events)
// NOTIFICATIONS
if (forNotifications.handles(row)) {
forNotifications.applyRealtime(id, row, eventsVals)
}
// more handlers here...
}, [
Query.or([
Query.equal('userId', forUserCredsId.value),
Query.equal('$id', forUserCredsId.value)
])
])
this.started = true
},
endWatch() {
if (this.subscription) this.subscription.close()
this.subscription = null
this.started = false
}
}
})'
I have tried different browsers, private mode, and changing databases to tablesdb in for each channel, but still get the same error
Could this be a skill issue on my end 🤣
In this it shows that it connects and disconnects immediently
Recommended threads
- How to stop my project from being frozen...
So we encountered an error in production because our appwrite project had been frozen due to inactivity. Is there any way of automating checking in and activity
- 403 The current user has been blocked.
Hello, I have a free plan; I've tried to access my project and I get the message "403 The current user has been blocked." I have database, sites, and auth in us...
- [Bug?] row_already_exists (409) after ma...
Hi, I'm experiencing a confusing issue with Appwrite Cloud Setup: A `tournaments` table with a composite UNIQUE index on (tournament_name, date). Steps to rep...