Skip to content

Commit c945ecc

Browse files
author
Zhen Li
committed
Fix cypher queries to drop contraints and indexes
1 parent 713a5c6 commit c945ecc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/internal/stream-observers.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ class ResultStreamObserver extends StreamObserver {
9797
this._discardFunction = discardFunction
9898
this._discard = false
9999
this._fetchSize = fetchSize
100+
this._finished = false
100101
}
101102

102103
/**
@@ -188,6 +189,7 @@ class ResultStreamObserver extends StreamObserver {
188189

189190
delete meta.has_more
190191
} else {
192+
this._finished = true
191193
const completionMetadata = Object.assign(
192194
this._connection ? { server: this._connection.server } : {},
193195
this._meta,
@@ -279,6 +281,7 @@ class ResultStreamObserver extends StreamObserver {
279281
this._head = []
280282
this._fieldKeys = []
281283
this._tail = {}
284+
this._finished = true
282285
}
283286

284287
/**
@@ -299,6 +302,7 @@ class ResultStreamObserver extends StreamObserver {
299302
return
300303
}
301304

305+
this._finished = true
302306
this._hasFailed = true
303307
this._error = error
304308

@@ -354,7 +358,7 @@ class ResultStreamObserver extends StreamObserver {
354358
}
355359
this._observers.push(observer)
356360

357-
if (this._reactive) {
361+
if (this._reactive && !this._finished) {
358362
this._handleStreaming()
359363
}
360364
}

test/rx/summary.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ describe('#integration-rx summary', () => {
670670

671671
const indices = await session.run('CALL db.indexes()')
672672
for (let i = 0; i < indices.records.length; i++) {
673-
await session.run(`DROP ${getName(indices.records[i])}`)
673+
await session.run(`DROP INDEX ${getName(indices.records[i])}`)
674674
}
675675
} finally {
676676
await session.close()

0 commit comments

Comments
 (0)