Back

After a period of inactivity, the connected real-time socket stops sending updates.

  • 1
  • Self Hosted
  • Realtime
xue
28 Mar, 2024, 20:43

I'm currently facing a critical issue with the Appwrite Realtime socket, which is related with this issue is still open.

The problem arises when there's a period of inactivity on the real-time socket. During this time, the socket stops sending any data. It behaves as if the connection has dropped, but it doesn't actually close the connection. The socket appears to be active but doesn't transmit any information.

However, when the socket eventually drops after this period of inactivity, it reconnects and starts functioning properly again.

TL;DR
Developers experiencing real-time socket issues, even without Cloudflare, with concerns about idle sockets and updates not being sent. Some found that Cloudflare inadvertently improved the situation. Refreshing the connection manually seems to help. The problem seems different for self-hosted Appwrite 1.5.3 with SDK-for-web 14.0.0. Fix: Ensure no Cloudflare or reverse proxy interference and consider manual refresh options.
Steven
28 Mar, 2024, 22:31

that issue is slightly different.

Are you connecting to Appwrite Cloud?

xue
28 Mar, 2024, 22:32

self-hosted appwrite: 1.5.3 sdk-for-web: 14.0.0

D5
28 Mar, 2024, 23:52

I've seem some issues like this one recently but in cloud. Not sure if both are related or have the same root cause

xue
11 Apr, 2024, 09:44

Do i need it convert it an GH issue ?

Mosh Ontong
11 Apr, 2024, 09:48

I also experience this thing in flutter and connecting to appwrite cloud

Mosh Ontong
11 Apr, 2024, 09:49

that is why in my case that every screen that has fetching items, I have always refresh icon button here so it is treat as the alternative way to refresh the realtime connection.

Steven
11 Apr, 2024, 18:37

your problem is probably different

Steven
11 Apr, 2024, 18:40

do you have anything in front of Appwrite? Like Cloudflare? or a reverse proxy?

Tessa
11 Apr, 2024, 18:42

Thanks @xue we have resolved that. I appreciate you reporting this 🙂

xue
11 Apr, 2024, 19:06

sorry i didn’t want to share here 😅 it was my fault, unrelated and deleted, you got the point so no problem 😅

xue
11 Apr, 2024, 19:09

while im reporting this issue and recording this video, i didn’t have anything in front of appwrite. i was using realtime socket directly, now i have Cloudflare but its the same.

Steven
11 Apr, 2024, 19:28

cloudflare would definitely cause problems. cloudflare kills idle websocket connections after a minute

Steven
11 Apr, 2024, 19:28

so with cloudflare disabled. what do the realtime container logs show?

zionnite.
11 Apr, 2024, 19:31

I too I'm having this issue in flutter SDK, sometimes the realtime does not update.

There is no any cloudfare relating to my project

D5
11 Apr, 2024, 20:24

We made several tests and the result ends up being the same with or without cloudflare. In fact from what we have seen cloudflare killing the connection reduced the issue 😅

xue
11 Apr, 2024, 22:30

actually Cloudflare fixed it unwillingly in web app because its killing the socket after a minute then browser can reconnect it 😄 however whenever socket starts idling and not disconnected, this is our main issue 🙂 if something kills the socket when it starts for idling, gonna be a solution because im sure that it will be reconnected it again.

Steven
12 Apr, 2024, 00:10

Hmm. What's in the realtime docker logs?

And what kind of load do you have?

And how long has the realtime container been running?

zionnite.
15 Apr, 2024, 09:14

What about users that are not behind any cloudfare that are still experiencing this issue?

D5
15 Apr, 2024, 15:57

Are you experiencing it?

zionnite.
15 Apr, 2024, 16:01

Yes, I am

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more