Skip to content

Commit 5c324a2

Browse files
authored
Move queueing channel observer to after packing the struct (#1334)
1 parent ede4211 commit 5c324a2

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

packages/bolt-connection/src/bolt/bolt-protocol-v1.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -499,18 +499,17 @@ export default class BoltProtocol {
499499
* @param {boolean} flush `true` if flush should happen after the message is written to the buffer.
500500
*/
501501
write (message, observer, flush) {
502+
this._lastMessageSignature = message.signature
503+
const messageStruct = new structure.Structure(message.signature, message.fields)
504+
505+
this.packable(messageStruct)()
502506
const queued = this.queueObserverIfProtocolIsNotBroken(observer)
503507

504508
if (queued) {
505509
if (this._log.isDebugEnabled()) {
506510
this._log.debug(`C: ${message}`)
507511
}
508512

509-
this._lastMessageSignature = message.signature
510-
const messageStruct = new structure.Structure(message.signature, message.fields)
511-
512-
this.packable(messageStruct)()
513-
514513
this._chunker.messageBoundary()
515514
if (flush) {
516515
this._chunker.flush()

packages/neo4j-driver-deno/lib/bolt-connection/bolt/bolt-protocol-v1.js

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)