-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Node.js, React Native
-
2 - S (<= 1 week)
-
5148
How frequently does the bug occur?
All the time
Description
I can't close the watch stream unless I get at least one change from the stream.
watch.return() only works when the for loop is executed at least once.
Stacktrace & log output
No response
Can you reproduce the bug?
Yes, always
Reproduction Steps
const watch = col.watch({ filter: { operationType: "insert", }, }); setTimeout(() => { console.log("timed out"); watch.return(); }, 10 * 1000); for await (const change of watch) { const { fullDocument } = change; console.dir(fullDocument); } console.log("this is never printed");
I don't insert a document for 10 seconds, then it should run the last console.log, but it doesn't and stuck in for loop.
If I insert one within 10 seconds, it works as expected.
Version
"realm": "11.3.0"
What SDK flavour are you using?
Atlas App Services (auth, functions, etc.)
Are you using encryption?
No, not using encryption
Platform OS and version(s)
Node
Build environment
Which debugger for React Native: ..
Cocoapods version
No response