Socket
Book a DemoInstallSign in
Socket

level-live-stream_issues_7

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

level-live-stream_issues_7

a test case for live stream stack overflow due to sublevel objects getting sent to stream serilizer.

latest
npmnpm
Version
0.0.0
Version published
Maintainers
1
Created
Source

this is a test case for

##https://github.com/dominictarr/level-live-stream/issues/7


git clone git@github.com:soldair/level-live-stream_issues_7.git && npm install && npm test

cause

when you bind level-hooks and specify a sublevel as prefix.

var subdb = db.sublevel('s');
db.pre(function(ch,add){
  if(ch.type == "put") add({type:"put",key:ch.key,value:ch.value,prefix:subdb});
})

if you use level-live-stream on a section of the database that overlaps that sublevel's range.

var livestream = require('level-live-stream');
var ls = livestream.install(db);

db.livestream().on('data',function(change){
  if(change.prefix) console.log(change.prefix === subdb, ' im broken');
})

using multilevel. when trying to serialize the sublevel object to send to a client we blow the stack.

it may not be the expected behavior for the prefix key to bubble out of level-hooks its certainly not the expected behavior for it to be sent from pull-level its never the expected behavior for this to be emitted as data from level-live-stream

FAQs

Package last updated on 07 Feb 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts