RubenVerborgh / AsyncIterator

An asynchronous iterator library for advanced object pipelines in JavaScript
https://rubenverborgh.github.io/AsyncIterator/docs/
Other
48 stars 7 forks source link

Fix ClonedIterators not being readable #99

Closed rubensworks closed 1 year ago

rubensworks commented 1 year ago

Since ClonedIterators are not autoStarted, they should be marked as readable. Otherwise, dependents may never consider them as being readable.

This lies at the root cause of the following Comunica bugs, where execution would halt due to an intermediary iterator never becoming readable:

rubensworks commented 1 year ago

Not sure about the test failure, as it seems to be happening in code that this PR does not touches, and only for Node 10 (which is out of LTS).

jeswr commented 1 year ago

Doing a bit of dig into this at the moment; for https://github.com/comunica/comunica/issues/1168 I've observed that the issue is only occuring when taking the .clone() of CloneIterators in the INIT _state. Will come back to this later in the day.

note: I was expecting https://github.com/RubenVerborgh/AsyncIterator/pull/100/files to be a minimal repro of this but sadly it was not so will continue digging.

rubensworks commented 1 year ago

@RubenVerborgh (or @jeswr?) Any chance this PR might be merged? I'm sure @pheyvaer would be very happy to see this issue resolved.

RubenVerborgh commented 1 year ago

Thanks! The test failure is indeed very weird. Not that we need Node 10 support, but it's sometimes a canary for things going wrong.

RubenVerborgh commented 1 year ago

The test failure was just a fluke, works fine on main. Releasing next.