useEffect(() => {
let subscription: RealtimeSubscription;
async function loadChips() {
try {
const {rows: chips} = await databases.listRows({
databaseId: appwriteConfig.databaseId,
tableId: appwriteConfig.boardsTableId
});
setChips(chips as unknown as BoardChip[]);
} catch (err) {
console.error(`Couldn't load chips: ${err}`);
} finally {
setIsLoadingChips(false);
}
}
async function realtimeSub() {
const channel = `databases.${appwriteConfig.databaseId}.tables.${appwriteConfig.boardsTableId}.rows`;
console.log(channel);
subscription = await realtime.subscribe(
channel,
(event) => {
if (event.events.some(eventName => eventName.endsWith('.create'))) {
setChips(prevChips => [...prevChips, event.payload as BoardChip]);
} else if (event.events.some(eventName => eventName.endsWith('.update'))) {
setChips(prevChips => prevChips.map(chip => chip.$id === event.payload.$id ? event.payload as BoardChip : chip));
} else if (event.events.some(eventName => eventName.endsWith('.delete'))) {
setChips(prevChips => prevChips.filter(chip => chip.$id !== event.payload.$id));
}
}
);
}
loadChips();
realtimeSub();
return () => {
subscription?.unsubscribe();
};
}, []);
for some reason in the network tab i get an error as a realtime message saying Missing Channels (code 1008). I checked and the Channel is not undefined and seems to be correct. I also tried using the new Channel-Builder to no avail :/ any ideas?
Im using self-hosted instance with 1.9.1 and latest sdk version
[SOLVED] Realtime Missing Channels
The fix is apparently using sdk version 23.0.0
Recommended threads
- education plan not activated
Hi I have an edu id 13103046@iubat.edu but when I am trying to claim my plan and trying to logging with github where education student plan active. the appwrite...
- I'm getting an error on the console "j?....
On my self hosted instance version 1.8.1 the console is giving me this error when trying to view the rows for a table I recently created. My application is read...
- 500 simultaneous OAuth logins from the s...
Hi, I'd like to ask about rate limiting around Google OAuth login on Appwrite Cloud. **OVERVIEW** Service type: A PWA (web app) for members of a university clu...