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
- Not allowed permission to upsert a prese...
```js const presenceID = ID.unique(); setPID(presenceID); const presence = await presences.upsert({ presenceId: presenceID, status: "online"...
- Finding job
Hi. I am a full-stack developer with experience in developing scalable and user-friendly web applications. I handle both front-end and back-end development, im...
- Can't really use the S3 storage device
hi, I've linked my local MinIO Instance (it's just for testing, not for prod.) to my appwrite instance, when i'm uploading a file it's getting uploaded to the S...