File tree 2 files changed +26
-5
lines changed
2 files changed +26
-5
lines changed Original file line number Diff line number Diff line change @@ -37,18 +37,19 @@ try {
37
37
return new buf . NodeBuffer ( new node . Buffer ( str , "UTF-8" ) ) ;
38
38
} ,
39
39
"decode" : function ( buffer , length ) {
40
+ let start = buffer . position ,
41
+ end = start + length ;
42
+ buffer . position = end ;
43
+
40
44
if ( buffer instanceof buf . NodeBuffer ) {
41
- let start = buffer . position ,
42
- end = start + length ;
43
- buffer . position = end ;
44
45
return buffer . _buffer . toString ( 'utf8' , start , end ) ;
45
46
}
46
47
else if ( buffer instanceof buf . CombinedBuffer ) {
47
- let out = streamDecodeCombinedBuffer ( buffer . _buffers , length ,
48
+ let out = streamDecodeCombinedBuffer ( buffer . _buffers , end ,
48
49
( partBuffer ) => {
49
50
return decoder . write ( partBuffer . _buffer ) ;
50
51
} ,
51
- ( ) => { return decoder . end ( ) ; }
52
+ ( ) => { return decoder . end ( ) . slice ( start , end ) ; }
52
53
) ;
53
54
return out ;
54
55
}
Original file line number Diff line number Diff line change @@ -249,4 +249,24 @@ describe('session', function() {
249
249
// Then
250
250
expect ( session . beginTransaction ) . toThrow ( ) ;
251
251
} ) ;
252
+ it ( 'should return lots of data' , function ( done ) {
253
+ session . run ( "UNWIND range(1,1000) AS x CREATE (t:testNode {name: 'testNameString'})" )
254
+ . then ( function ( ) {
255
+ session . run ( "MATCH (n) RETURN n.name" )
256
+ . subscribe ( {
257
+ onNext : function ( record ) {
258
+ var node = record . get ( 'n' ) ;
259
+ expect ( node . name ) . toEqual ( "testNameString" ) ;
260
+ } ,
261
+ onCompleted : function ( ) {
262
+ // Completed!
263
+ session . close ( ) ;
264
+ done ( )
265
+ } ,
266
+ onError : function ( error ) {
267
+ console . log ( error ) ;
268
+ }
269
+ } )
270
+ } ) ;
271
+ } ) ;
252
272
} ) ;
You can’t perform that action at this time.
0 commit comments