Hi, i am not able to unsubscribe after the unmount, here is the code
const unsubscribe = client.subscribe(
`databases.${process.env.NEXT_PUBLIC_DATABASE_ID}.collections.${process.env.NEXT_PUBLIC_CHATS_COLLECTION}.documents`,
response => {
console.log(response);
},
)
return () => {
unsubscribe();
console.log('unsubscribed');
}
}, [])```
realtime connection staying the same in appwrite dashboard, even after unmount.
i also notice something, it's only happens, when i switch pages with next/Link component, and not with ahref tags
Do you have subscriptions on some other part of your app? Or another page?
Is the unsubscribed being logged?
i am importing {client} variable from appwrite-utils.js and then using it in a chat page, i am not using it anywhere else. And yes, unsubscribed log is showing in the console.
Oh...you're saying the usage stats are not up to date...the usage stuff might be delayed. We're rewriting all of that.
You should be fine. You can check the network logs and switch to the WS tab to confirm the websocket is disconnected
Recommended threads
- is `account.get()` safe to be used in th...
I want to user's `id` for authentication. However, a while ago I was told in this server not to use `account.get()` and instead add user preferences for that us...
- Usage of the new Client() and dealing wi...
Hey guys, just a quick one - we had some web traffic the other day and it ended up bombing out - To put in perspective of how the app works, we have a Nuxt Ap...
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...