Skip to content
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

@ezs/lodex formatOutput: empty stream breaks JSON #227

Open
parmentf opened this issue Mar 30, 2022 · 0 comments
Open

@ezs/lodex formatOutput: empty stream breaks JSON #227

parmentf opened this issue Mar 30, 2022 · 0 comments
Labels
@ezs/lodex Concerns @ezs/lodex question Further information is requested

Comments

@parmentf
Copy link
Collaborator

if (this.isLast()) {
feed.write(']}\n');
return feed.close();
}
if (this.isFirst() && !this.isLast()) {

What happens when the first chunk is also the last one?
The output should be ]}\n, and the stream closed.
That is not parseable.

Or does ezs not call the statement when the stream is empty?

Maybe linked: @jj618 queried a lodex routine (all-documents), and sometimes encountered an unfinished JSON response.
It lacked only ]}\n, which seems to be linked to formatOutput, which is an alias of the used LodexOutput statement.
It happened only in important volumes (maybe @jj618 can provide the numbers).

@parmentf parmentf added question Further information is requested @ezs/lodex Concerns @ezs/lodex labels Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ezs/lodex Concerns @ezs/lodex question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant