antoniogarrote / rdfstore-js

JS RDF store with SPARQL support
MIT License
564 stars 109 forks source link

Fixed normalizeQuad call for observeQuery #95

Closed Weissger closed 9 years ago

Weissger commented 9 years ago

I experienced a crash in the browser version of rdfstore-js while using startObservingNode.

QueryEngine.prototype.normalizeQuad doesn't return anything but uses a callback. I fixed the call in Callbacks.CallbacksBackend.prototype.observeQuery by providing a proper callback function.

antoniogarrote commented 9 years ago

Hi @Weissger, thank you very much for the PR. It was a migration error into the 0.9.x branch. The function used to be synchronous, now everything is completely asynchronous.

I have added part of your refactor in: https://github.com/antoniogarrote/rdfstore-js/commit/f949a3f16df92cb1893bde10e094fe0380a489e5

I made a small modification to use eachSeries instead of a for loop, to prevent the callbacks to be fired before the initiall callback and the invocation to the final callback are invoked.

Tests are passing but I will add some specs to catch the problem before closing the PR.

Thank you very much.