Skip to content

Conversation

@andrew-coleman
Copy link
Member

Created a test driver to run the test suite in async mode
Fixed all failing test cases. These all involved functions which needed to asynchronously invoke the evaluator (such as the higher-order functions, the sort syntax & function chaining operator)

resolves #217

@coveralls
Copy link

coveralls commented May 10, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 6012dd5 on async_fixes into acca902 on master.

@xogeny
Copy link
Contributor

xogeny commented May 10, 2018

As far as I can tell (correct me if I'm wrong), the change here is to pass a callback to JSONata. I think more rigor should be employed here. For example, passing the dataset as a Promise and the bindings as Promises as well. Ideally, also including variations that do the same with generators.

In analyzing this myself, my thinking was that there are essentially 3 fundamental sources for values in JSONata (again, correct me if I'm wrong). Those are input data set, bindings and results from function evaluations. It is those cases where we have to check whether something is a "normal" value, a Promise or a generator. So my point here is that it seems that your change looks at the function return values. But it doesn't exercise the other two cases. Am I correct?

@andrew-coleman
Copy link
Member Author

This change doesn't alter the externals for triggering async mode, it merely tests it properly and fixes the failing cases. I agree that we could modify the API to allow the passing in of promises as you suggest, but this goes beyond the scope of this bug fix.

@mattbaileyuk mattbaileyuk merged commit e3f030d into master May 10, 2018
@mattbaileyuk mattbaileyuk deleted the async_fixes branch May 10, 2018 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

$filter returns undefined in async mode

5 participants