f4ls3Original post
Rank 2: Process
JavaScript
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?
Summary
[***SOLVED***] Realtime Missing Channels
Developers experiencing missing channel errors in Realtime messages resolved the issue by switching to SDK version 23.0.0.