appwrite
appwrite copied to clipboard
🚀 Feature: Realtime event triggers
🔖 Feature description
We should add new event types that can trigger a function. Alongside existing ones, we should add new ones for real-time events, such as user connection or disconnection.
🎤 Pitch
Currently, I am trying to build a real-time game and I need to know when a user disconnect, so I can do cleanup on the client-side of other players - remove a character of a player who disconnected. I don't think this is possible using current real-time features.
👀 Have you spent some time to check if this issue has been raised before?
- [X] I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- [X] I have read the Code of Conduct
@TorstenDittmann do you think it will make sense to add a callback for when the user disconnect?
Not sure how the channel and permissions should look like for this 🤔
Not sure how the channel and permissions should look like for this 🤔
Maybe for start, just allow callbacks in the SDK level, no implementation on the server side, or is that already supported?
I also need some user presence detection. Is there any movement on this ?
@TorstenDittmann Any update? I am planning to set up a chat server and need the user's Online / Offline presence support. Is there any workaround you can suggest to how to handle the user's disconnection or point to some resource?
I think this is really helpful for real-time chat apps. Rest can be handled by real-time updates from collections. But the socket connects and disconnect event is missing which can be added.
Waiting for an update.
Regards, Punit Diwan
Any update on this? The mentionned issue is not about presence system, it's about client-side events
Yes, it would be nice to handle clientside connects/disconnects. I think it's an important action when we use Realtime data. There is any solution to handle that?
I think the possible solutions:
- Allow to use custom realtime implementation. (Currently it's
private) ( https://github.com/appwrite/sdk-for-web/blob/master/src/client.ts#L182 ) It can gives a lot of options to change default realtime implementation. Like changegetTimeoutlogic, write attempt limiter, etc. - Create Callback like:
onRealtimeConnectionChanged() - Use channels ( https://github.com/appwrite/sdk-for-web/issues/40#issuecomment-1259837819 )
Is this feature being considered? I've also seen this feature request on the appwrite discord regularly.
It is very old requested feature, but also it has still high-demand like push-notifications feature.
I came here from firebase, when i was in DB, i solve presence issue by writing Cloud Function there. Anyways, my migration from firebase to appwrite almost completed except this issue.
Is it possible way to solve it by writing an appwrite cloud function ? If yes, please link, mention, any referance, sample function or readings that i need. Because it seems like it will take time for this feature to be released. Big Thanks!
any update on this ?? @stnguyen90
I am also waiting an update about it as well.