-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
Goals
I would like to open a change stream to get notified of changes to a collection.
Expected Results
The client receives changes until the change stream is closed.
Actual Results
The change stream times out after a few minutes (according to the Realm logs, the stream stays open for about 90 to 240 seconds) and receives no more change events. The following error message is logged in the browser console.
Uncaught (in promise) WatchError: execution time limit exceeded WatchError https://unpkg.com/realm-web@1.1.0/dist/bundle.iife.js:9540 feedSse https://unpkg.com/realm-web@1.1.0/dist/bundle.iife.js:9686 feedLine https://unpkg.com/realm-web@1.1.0/dist/bundle.iife.js:9611 advanceBufferState https://unpkg.com/realm-web@1.1.0/dist/bundle.iife.js:9746 feedBuffer https://unpkg.com/realm-web@1.1.0/dist/bundle.iife.js:9590 watch https://unpkg.com/realm-web@1.1.0/dist/bundle.iife.js:9916
Steps to Reproduce
- Open a change stream for a collection.
- Wait for two to four minutes.
- Insert or update a document in the collection to trigger a change event.
- The client doesn't receive the event and the error message appears in the console.
Code Sample
async function reproduction() { const app = new Realm.App("<app id>"); await app.logIn(Realm.Credentials.anonymous()); const collection = app.currentUser .mongoClient("mongodb-atlas") .db("<database>") .collection("<collection>") for await (const change of collection.watch()) { console.log(change); } }
Version of Realm and Tooling
- Realm JS SDK Version: 1.1.0
- Node or React Native: Browser
- Client OS & Version: Linux, Firefox 85