appwrite icon indicating copy to clipboard operation
appwrite copied to clipboard

🚀 Feature: Realtime event triggers

Open Meldiron opened this issue 3 years ago • 12 comments

🔖 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?

Meldiron avatar Nov 14 '21 14:11 Meldiron

@TorstenDittmann do you think it will make sense to add a callback for when the user disconnect?

eldadfux avatar Nov 15 '21 05:11 eldadfux

Not sure how the channel and permissions should look like for this 🤔

TorstenDittmann avatar Nov 15 '21 10:11 TorstenDittmann

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?

eldadfux avatar Nov 29 '21 06:11 eldadfux

I also need some user presence detection. Is there any movement on this ?

weepy avatar Jul 23 '22 11:07 weepy

@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

punitdiwan avatar Sep 21 '22 14:09 punitdiwan

Any update on this? The mentionned issue is not about presence system, it's about client-side events

pepperoni21 avatar Dec 28 '22 18:12 pepperoni21

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:

  1. 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 change getTimeout logic, write attempt limiter, etc.
  2. Create Callback like:onRealtimeConnectionChanged()
  3. Use channels ( https://github.com/appwrite/sdk-for-web/issues/40#issuecomment-1259837819 )

kecsot avatar Apr 20 '23 14:04 kecsot

Is this feature being considered? I've also seen this feature request on the appwrite discord regularly.

KimCalvin avatar Jun 08 '23 09:06 KimCalvin

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!

xuelink avatar Sep 28 '23 01:09 xuelink

discord related link Screenshot 2023-10-17 at 19 01 15

Up!

xuelink avatar Oct 17 '23 16:10 xuelink

any update on this ?? @stnguyen90

emilepavie avatar Jan 23 '24 08:01 emilepavie

I am also waiting an update about it as well.

xuelink avatar Mar 08 '24 12:03 xuelink