-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
Goals
Cancelling a watch on collections should yield no errors.
Expected Results
It shouldn't be an error to cancel watching a collection.
We might be more successful if we made the react-network-transport take a signal that can be used to cancel the underlying request instead of cancelling a stream locked to a reader actively reading.
Actual Results
In the current implementation of cancellation of the watch requests we're calling cancel on a ReadableStreamDefaultReader which will throw if the is awaiting the next change while cancelling. This results in an error logged in the console when closing the stream / connection which is unexpected.
> net::ERR_FAILED 200
Steps to Reproduce
Watch a collection and call return on the AsyncIterator returned from the call after awaiting a read of the next change.
Code Sample
<!---
Please provide a code sample or test case that highlights the issue.
If relevant, include your model definitions.
For larger code samples, links to external gists/repositories are preferred.
Full projects that we can compile and run ourselves are ideal!
-->
Version of Realm and Tooling
- Realm Web SDK Version: 1.3.0