Skip to content

bug on result-summary.js (with temporary fix) #477

Closed
@gregja

Description

@gregja

I found a bug on the "result-summary.js" file, with the pos.offset.toInt() function 👍

D:\Documents\nodetests\neo4jtest\node_modules\neo4j-driver\lib\v1\result-summary.js:391
offset: pos.offset.toInt(),
^
TypeError: pos.offset.toInt is not a function
at Function._constructPosition (D:\Documents\nodetests\neo4jtest\node_modules\neo4j-driver\lib\v1\result-summary.js:391:28)
at new Notification (D:\Documents\nodetests\neo4jtest\node_modules\neo4j-driver\lib\v1\result-summary.js:380:34)
at D:\Documents\nodetests\neo4jtest\node_modules\neo4j-driver\lib\v1\result-summary.js:135:16
at Array.map ()
at ResultSummary._buildNotifications (D:\Documents\nodetests\neo4jtest\node_modules\neo4j-driver\lib\v1\result-summary.js:134:28)
at new ResultSummary (D:\Documents\nodetests\neo4jtest\node_modules\neo4j-driver\lib\v1\result-summary.js:103:31)
at Object.onCompletedWrapper [as onCompleted] (D:\Documents\nodetests\neo4jtest\node_modules\neo4j-driver\lib\v1\result.js:170:19)
at SessionStreamObserver.onCompleted (D:\Documents\nodetests\neo4jtest\node_modules\neo4j-driver\lib\v1\internal\stream-observer.js:100:26)
at SessionStreamObserver.onCompleted (D:\Documents\nodetests\neo4jtest\node_modules\neo4j-driver\lib\v1\session.js:350:117)
at Connection._handleMessage (D:\Documents\nodetests\neo4jtest\node_modules\neo4j-driver\lib\v1\internal\connection.js:305:35)

The original code (lines 390 and following on the file result-summary.js)
return {
offset: pos.offset.toInt(),
line: pos.line.toInt(),
column: pos.column.toInt()
};

To avoid this bug, I applied temporarily the workaround below :
return {
offset: Math.ceil(Number(pos.offset)),
line: Math.ceil(Number(pos.line)),
column: Math.ceil(Number(pos.column))
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions