Skip to content

QueryToReadAll on a Query with no results produces no response #647

Closed
@georgeajit

Description

@georgeajit

Code hangs when no results are returned by queryAll / queryToReadAll calls. The code snippet below can be used to reproduce the issue:

//queryToReadAll zero results
    it('zero', function(done) {
        //it('verify queryToReadAll documents with word query', function(done) {
        this.timeout(20000);
        const query = q.where(ctsqb.cts.wordQuery('zero'));
        var res = '';
        var chk = '';
        const queryToReadAllStream = dbWriter.documents.queryToReadAll(query,{
            onCompletion:((summary) => {
                res = summary;
            })
        });
        queryToReadAllStream.on('error', function (err) { console.log(err);});
        queryToReadAllStream.on('data', function(chunk){
            chk = chunk;
        });
        queryToReadAllStream.on('end', function(end){
            done();
        });
        expect(res).to.be.empty;
        expect(chk).to.be.empty;
    });

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions