Jesse Wright
Jesse Wright
`wrap` can now bypass the `WrappingIterator` in certain cases (e.g. if it was already an AsyncIterator, it will just return the input). In such cases `_fillBuffer` will not exist.
Not sure why this would be a problem on some sparql endpoints and not others though - it shouldn't change the nature of the iterator
FYI there is a fix in the works - we just need to release [some upstream changes](https://github.com/RubenVerborgh/AsyncIterator/pull/80#issuecomment-1207371390) first.
I'd say this is likely caused by https://github.com/RubenVerborgh/AsyncIterator/issues/44 given the number of transformations in the Federated components. Might be worth checking this again once that issue is closed.
I briefly tried this - but it actually becomes a bit difficult without creating a circular dependency since the following type which contains the `ActionContextKey` needs to be used in...
Adding on to this, it appears that anything equivalent to 'empty' has the same problem. For instance `union([])` and `union([empty()])` suffer from the same problem.
Further I ran some tests to check that this problem was not in the `n3` or `asynciterator` libs - I can confirm that the following run without error ```ts async...
I've added some more tests to narrow down on the problem [here](https://github.com/jeswr/comunica/tree/fix/rdfjs-empty-iterator). It looks like the stream is somehow being intercepted before the `run` call in `ActorRdfUpdateQuadsDestination` as the following...
Ahh - so the problem is the `await` all before the use of `quadStreamInsert`, as evidenced by the failure of the following test - I'll open an issue in the...
> Can we replace wrap with a simple custom AsyncIterator that skips buffering? Yep - importantly, I think `wrapAsyncIterator` here (and in all similar usages) https://github.com/comunica/comunica/blob/6199e753efbe4d5658b5ef9ef500012525f093e3/packages/actor-rdf-resolve-quad-pattern-rdfjs-source/lib/RdfJsQuadSource.ts#L29 should become something like...