appwrite / sdk-for-web

[READ-ONLY] Official Appwrite Web SDK 🧑

Home Page:https://appwrite.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ› Bug Report: React Native Realtime

rohankm opened this issue Β· comments

πŸ‘Ÿ Reproduction steps

When i Subscribe to any events on react native expo. every 30sec to 1min I get "Realtime got disconnected. Reconnect will be attempted in 1 seconds., undefined" error.

Steps to reproduce

  1. just create a react native expo app
  2. subscribe to any collection and check the console logs

πŸ‘ Expected behavior

connection should be stable

πŸ‘Ž Actual Behavior

Screenshot 2022-07-08 at 5 17 45 AM

🎲 Appwrite version

Version 0.10.x

πŸ’» Operating system

MacOS

🧱 Your Environment

No response

πŸ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏒 Have you read the Code of Conduct?

Do you have cloudflare or any reverse proxy in front of appwrite?

Do you have cloudflare or any reverse proxy in front of appwrite?

im using nginx as reverse proxy

im using nginx as reverse proxy

Your web socket may be timing out. Do you have various timeout directives in place? See this.

On a side note...how did you get realtime working on react native? I thought it didn't work due to window being undefined.

im using nginx as reverse proxy

Your web socket may be timing out. Do you have various timeout directives in place? See this.

On a side note...how did you get realtime working on react native? I thought it didn't work due to window being undefined.

to be honest I have no idea! somehow the realtime is working and window.localstorage is not causing many issues except console logging periodically

im using nginx as reverse proxy

Your web socket may be timing out. Do you have various timeout directives in place? See this.

On a side note...how did you get realtime working on react native? I thought it didn't work due to window being undefined.

i added

proxy_connect_timeout 7d;
proxy_send_timeout 7d;
proxy_read_timeout 7d;

to my nginx config file and I see that the bug is gone now. Thanks :)