invisible-college / statebus

All aboard the STATEBUS!!!
117 stars 5 forks source link

bus.del(key) throws "Cannot read property 'key' of undefined" #23

Closed tkriplean closed 7 years ago

tkriplean commented 7 years ago

Log info & stacktrace:

del: delete_me
route: master("delete_me").to_delete[1](key:"delete_me")
Listening on http//:<host>:3099
skipping function funk() {..} already at version master0
Cleaning up 2 funks
Clean-early: master('*').on_save = function on_save({"key":"connections"}) {..}
Clean-early: master('*').on_save = function on_save() {..}
TypeError: Cannot read property 'key' of undefined
  at /Users/travis/Documents/code/statebus5/statebus.js:781:45
  at funk (/Users/travis/Documents/code/statebus5/statebus.js:903:35)
  at Function.funk.react (/Users/travis/Documents/code/statebus5/statebus.js:951:26)
  at Timeout.clean [as _onTimeout] (/Users/travis/Documents/code/statebus5/statebus.js:480:39)
  at tryOnTimeout (timers.js:224:11)
  at Timer.listOnTimeout (timers.js:198:5)

Test case:

bus = require('statebus/server')({
  full_node: true
})

bus.honk = true

bus.del 'todo'

With db file:

{
 "todo": {
  "key": "todo",
  "text": "test"
 }
}
toomim commented 7 years ago

I've reproduced this, thanks.

toomim commented 7 years ago

It's working.