appwrite / sdk-for-web

[READ-ONLY] Official Appwrite Web SDK ๐Ÿงก
https://appwrite.io
BSD 3-Clause "New" or "Revised" License
273 stars 59 forks source link

๐Ÿ› Bug Report: React Native Realtime #28

Closed rohankm closed 1 year ago

rohankm commented 1 year ago

๐Ÿ‘Ÿ 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?

๐Ÿข Have you read the Code of Conduct?

stnguyen90 commented 1 year ago

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

rohankm commented 1 year ago

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

im using nginx as reverse proxy

stnguyen90 commented 1 year ago

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.

rohankm commented 1 year ago

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

rohankm commented 1 year ago

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 :)