Rank 3: Container
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
Votes
0
Replies
24
Participants
4
Messages
25
Rank 3: Container
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
Rank 3: Container
this is the network tab
Rank 3: Container
each socket name/header
Rank 3: Container
messages
Rank 3: Container
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
}
}
})'
Rank 3: Container
I have tried different browsers, private mode, and changing databases to tablesdb in for each channel, but still get the same error
Rank 3: Container
Could this be a skill issue on my end 🤣
Rank 3: Container
In this it shows that it connects and disconnects immediently
can you try again? Are you still seeing issues?
have you tried browsing to https://fra.cloud.appwrite.io in your browser?
Rank 3: Container
Yap just checked right now and am getting the issue
Rank 3: Container
Yap, fra.cloud.appwrite.io works perfectly
oh wait this is the websocket issue. Are you still seeing the issue?
Rank 3: Container
Let me check,
Rank 3: Container
Nope still failing
what's your project id?
i still can't reproduce
where is your app running from?
Rank 3: Container
Am testing on localhost(dev) but in prod its vercel
Rank 3: Container
I looked at the docs and found some changes where made to the channel structure
Rank 3: Container
Am this is mine 😂
Rank 3: Container
Let me make the modifications and test again
Rank 3: Container
well still getting this
Rank 3: Container
Rank 3: Container