Detect Realm Web SDK Watch() Drops

I’m using the watch() method on the web SDK to keep real time updates shown on my application screen. Sometime, for whatever reason, the watch() stops working. It can be after many hours on Chrome or almost immediately on mobile Safari.

Is there a way to detect a watch() that is no longer connected, so that I can have it reconnect upon this dropping?

have you found a solution or know why that happens?

Nope. Abandoned the SDK for a different solution.

the watch() Drops happen mostly on Firefox, any solution to this issue?

i recently create a react app by using realm web template app, the web-js one, and have this error show up every few second when fetching data. i think it is related with your watch() drops issue.

Uncaught (in promise) WatchError: rule with id="62ec12a7614......" no longer exists on mongodb service, closing watch stream
    at WatchStream.feedSse (
    at WatchStream.feedLine (
    at WatchStream.advanceBufferState (
    at WatchStream.feedBuffer (
    at MongoDBCollection.watchImpl (
    at async watchAction (useWatch.js:45:1)

is there a better place to rise the question to find out answers

I am having the same issue. Are there any solutions for detecting dropped watch()'s?

they created this sandbox

1 Like

i use chrome, it is the same

Li_Li3, thank you, this is heroic.

I fixed my issue by moving the rules from the default to individual collection, i am not sure why, but the watch error disappeared.