Skip to content

fatal crash related to gun.off() #48

@leonardpauli

Description

@leonardpauli

Not exactly sure what I did, but probably one of:

gun.get('testing').put({pointers: null})
gun.get(id).put(null)
gun.get(id).off()
gun.get(id).get(id2).off()
gun.get(id).map(v=> v.off())
gun.get(id).map().val(v=> v.off())
gun.get(id).map().val((v, k)=> gun.get(id).get(k).off())
const item = gun.get(id); item.map().val((v, k)=> item.get(k).off())

gun.get('name').put({key: 'value'});
gun.get('name').val(console.log)
gun.get('name').off()
gun.get('name').val(console.log)

...when trying to figure out how to remove data.

node_modules/levelup/lib/levelup.js:145
    throw new ReadError('get() requires a key argument')
    ^
ReadError: get() requires a key argument
    at LevelUP.get (/node_modules/levelup/lib/levelup.js:145:11)
    at Adapter.read (/node_modules/gun-level/dist/Adapter/index.js:114:20)
    at Object.next (/node_modules/gun-level/dist/index.js:32:14)
    at Object.onto [as on] (/node_modules/gun/gun.js:203:19)
    at Function.Gun.on.get (/node_modules/gun/gun.js:793:35)
    at Object.root [as next] (/node_modules/gun/gun.js:697:14)
    at Object.next (/node_modules/gun/nts.js:17:20)
    at Object.next (/node_modules/gun/lib/bye.js:11:45)
    at Object.onto [as on] (/node_modules/gun/gun.js:203:19)
    at receive (/node_modules/gun/lib/ws.js:84:7)
error Command failed with exit code 1.

I suspect context.get['#'] ("key") becomes null/undefined somehow which breaks it all, even after restart. Adding if (!key) return _this.afterRead(context, null) // possibly warn? or is this correct? at line 112 in /dist/Adapter/index.js should do.

...or just make it use the radix storage thing? :)

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