Skip to content

The example query-builder.js not completing #362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wooldridge opened this issue Feb 4, 2017 · 6 comments
Closed

The example query-builder.js not completing #362

wooldridge opened this issue Feb 4, 2017 · 6 comments

Comments

@wooldridge
Copy link
Contributor

When running all the examples at once, as described in the README, or when running query-builder.js alone, execution dies near the end of query-builder.js:

mwooldri$ node examples/query-builder.js 
Query documents with the Query Builder
Mayotte at /countries/mf.json
Seychelles at /countries/se.json
Morocco at /countries/mo.json
Burkina Faso at /countries/uv.json
Algeria at /countries/ag.json
Djibouti at /countries/dj.json
Cote d'Ivoire at /countries/iv.json
Mauritania at /countries/mr.json
Guinea at /countries/gv.json
Mali at /countries/ml.json
mwooldri$

It should end like this:

...
Mali at /countries/ml.json
Niger at /countries/ng.json
done
mwooldri$ 

All other examples complete successfully when run by themselves.

When query-builder.js is edited to use a promise instead of a stream (similar to how query-by-example.js uses a promise), the script completes successfully. So it appears to be an issue with streams in query-builder.js.

I'm running Node.js v6.5.0 and npm v3.10.3.

@wooldridge
Copy link
Contributor Author

@ayuwono, with this fix we've refactored how we check if a multipart object stream is finished. Can you add the following test to check that this works with all cases?

Get results that have two documents with metadata only (no content) as an object stream. (This will test the situation when metadata is the last part in the multipart queue.)

Thanks to @ehennum for his help on this!

@ayuwono
Copy link
Contributor

ayuwono commented May 16, 2017

Hi @wooldridge,

Is this fixed? I tried to run the example query-builder.js and it's still not completing

[ayuwono@ayuwono-z620 node-client-api]$ node examples/query-builder.js
Query documents with the Query Builder
Mayotte at /countries/mf.json
Seychelles at /countries/se.json
Morocco at /countries/mo.json
Burkina Faso at /countries/uv.json
Algeria at /countries/ag.json
Djibouti at /countries/dj.json
Cote d'Ivoire at /countries/iv.json
Mauritania at /countries/mr.json
Guinea at /countries/gv.json
Mali at /countries/ml.json
[ayuwono@ayuwono-z620 node-client-api]$

@ayuwono ayuwono removed their assignment May 16, 2017
@ayuwono ayuwono added verify and removed test labels May 16, 2017
@wooldridge
Copy link
Contributor Author

Update, the query-builder.js example should run like this, returning the first 10 results, so ending at "Mali at /countries/ml.json" followed by "done":

MacPro-3170:node-client-api-examples mwooldri$ node examples/query-builder.js 
Query documents with the Query Builder
Mayotte at /countries/mf.json
Seychelles at /countries/se.json
Morocco at /countries/mo.json
Burkina Faso at /countries/uv.json
Algeria at /countries/ag.json
Djibouti at /countries/dj.json
Cote d'Ivoire at /countries/iv.json
Mauritania at /countries/mr.json
Guinea at /countries/gv.json
Mali at /countries/ml.json
done
MacPro-3170:node-client-api-examples mwooldri$ 

@gvaidees
Copy link
Contributor

@wooldridge This is targeted for 9.0-2. Would you be able to take care of this?

@wooldridge
Copy link
Contributor Author

@gvaidees Thanks for the reminder. This was targeted for 9.0-2 but @ayuwono and I were having trouble seeing the fix resolve on Linux. So I am going to push it out to 9.0-3.

@wooldridge wooldridge modified the milestones: 9.0-3, 9.0-2 Jun 21, 2017
@wooldridge wooldridge modified the milestones: 9.0-4, 9.0-3 Sep 12, 2017
@wooldridge wooldridge reopened this Sep 12, 2017
@wooldridge
Copy link
Contributor Author

Should be fixed by #422. @ayuwono, needs QA.

@wooldridge wooldridge assigned ayuwono and unassigned wooldridge Oct 2, 2017
@ayuwono ayuwono removed their assignment Oct 31, 2017
@ayuwono ayuwono added ship and removed test labels Oct 31, 2017
@ayuwono ayuwono closed this as completed Oct 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants