RubenVerborgh/AsyncIterator

Lazy transform and union iterator never start

rubensworks opened this issue · 1 comments

In comunica/comunica#733, I discovered that some other queries started freezing (that didn't freeze before) since asynciterator version 3.0.2.

Related to #22.

Minimal reproducible example:

  const arrayIt = new ArrayIterator([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], { autoStart: false });
  const transformit = new TransformIterator(arrayIt, { autoStart: false });
  const unionIt = new UnionIterator([transformit], { autoStart: false });

  // The listeners below are never called
  unionIt.on('data', () => console.log('DATA'));
  unionIt.on('end', () => console.log('ENDED'));

It looks like the transform buffer is being filled partially, but its elements are never propagated upwards for some reason.

Thanks for reporting, fixed in v3.0.3