-
Notifications
You must be signed in to change notification settings - Fork 123
getStream doesn't emit end event #194
Copy link
Copy link
Open
Description
While trying to fix levelgraph/levelgraph-n3#25 I noticed the getStream method didn't emit an end or close event.
Will provide more details later, including example code to reproduce the issue.
Probably related to #186
Update 2021-12-08
While I was writing a bare-minimum showcase of this bug, everything seemed to work perfectly, not replicating the bug I saw when working on levelgraph-n3.
In the example:
- db = bare leveldb instance
- graph = basic levelgraph instance
- ex = wrapped levelgraph instance, like levelgraph-n3 returns
const level = require('level-mem');
const levelgraph = require('levelgraph');
const db = level();
const graph = levelgraph(db);
const ex = Object.create(graph);
// Insert example data
graph.put([
{
subject : 'hello-world-message',
predicate : 'type',
object : 'message',
}, {
subject : 'hello-world-message',
predicate : 'content',
object : 'Hello World',
}
]);
db.createReadStream()
.on('data', chunk => console.log('bare data', {chunk}))
.on('end', () => console.log('bare end'))
graph.getStream({ subject: 'hello-world-message' })
.on('data', chunk => console.log('graph data', {chunk}))
.on('end', () => console.log('graph end'))
ex.getStream({ subject: 'hello-world-message' })
.on('data', chunk => console.log('ex data', {chunk}))
.on('end', () => console.log('ex end'))Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels