-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚀 Feature: Websocket Connect and Disconnect Events #40
Comments
@Towerful, thanks for creating this issue! 🙏 Is this a duplicate of appwrite/appwrite#2418? If so, can this be closed? |
I don't think it is, perhaps I didn't explain myself well. I feel like that appwrite/appwrite#2418 is a server side feature. When a client disconnecting would trigger a function on the server, in order to track some sort of presence. I would be looking for client side events regarding the websocket connection status. Having a 'socket disconnected' event raised would allow me to tell the user the client has disconnected. I hope that makes sense. The events could be implemented as an {
events: ['realtime.disconnected'];
channels: string[];
timestamp: number;
payload: { };
}
{
events: ['realtime.reconnecting'];
channels: string[];
timestamp: number;
payload: {
attempt: number,
timeout: number
};
}
{
events: ['realtime.connected'];
channels: string[];
timestamp: number;
payload: { };
} which could be raised for all subscribed callbacks. I don't think this would be a breaking change, as implementations normally rely on |
I have had the same issue and sorted it eventually. basically with NGINX (default disconnect after 60 seconds so) cloudflare ...also disconnects after 100 seconds. (according to support) My Solutions: solution 2 (in cloudflare click dns only -- unselect proxied) and the problem goes away. F.Y.I |
i think it shou
this is exactly what i am thinking about, in sdk for dart there are events for |
🔖 Feature description
Have the Client.Realtime emit events when the websocket connects and disconnects
🎤 Pitch
Currently there is no way to detect this.
If the websocket disconnects and you are relying on the realtime connection to track data between the client and the database, you will miss CRUD events, and your client data may not reflect the database data.
With events indicating WSS connect and disconnect, this would allow feedback to the user that it is no longer realtime, and to do a full data refetch/refresh when the websocket connects.
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: