Racer assumes path input is valid #30

Closed
javaJake opened this Issue Aug 3, 2012 · 4 comments

Projects

None yet

4 participants

@javaJake

The following example code:

model.push('news', {title: params.body.title, abstract: params.body.abstract})

causes the following error:

..../default/node_modules/derby/node_modules/racer/lib/Memory.js:99
      throw new TypeError("" + arr + " is not an Array");
            ^
TypeError: [object Object] is not an Array
    at Object.Memory.push (..../default/node_modules/derby/node_modules/racer/lib/Memory.js:99:13)
    at applyTxn (..../default/node_modules/derby/node_modules/racer/lib/transaction.js:109:32)
    at Object.module.exports.applyTxn (..../default/node_modules/derby/node_modules/racer/lib/transaction.js:82:12)
    at applyTxn (..../default/node_modules/derby/node_modules/racer/lib/adapters/pubsub-memory/channel-interface-query.js:49:15)
    at Function.Object.create.publish.value [as publish] (..../default/node_modules/derby/node_modules/racer/lib/adapters/pubsub-memory/channel-interface-query.js:29:18)
    at PubSub.publish (..../default/node_modules/derby/node_modules/racer/lib/pubSub/PubSub.js:56:10)
    at Store.module.exports.proto.publish (..../default/node_modules/derby/node_modules/racer/lib/pubSub/pubSub.Store.js:179:20)
    at publish (..../default/node_modules/derby/node_modules/racer/lib/txns/txns.Store.js:113:15)
    at next (..../default/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
    at module.exports.events.middleware.txn (..../default/node_modules/derby/node_modules/racer/lib/txns/txns.Store.js:106:11)

This is because 'news' ought to read 'news.item'. However, this is not at all clear from the output. In fact, it appears that the code actually thought my input was valid, which is a bug in itself. Changing 'news' to 'news.item' causes this error to vanish.

The following happens if you use mongodb as a backend:

..../default/node_modules/derby/node_modules/racer/lib/Store.js:304
      throw new Error('No persistence handler for ' + method + '(' + args.join
            ^
Error: No persistence handler for push(news,[object Object],1)
    at next (..../default/node_modules/derby/node_modules/racer/lib/Store.js:304:13)
    at next (..../default/node_modules/derby/node_modules/racer/lib/Store.js:312:14)
    at Store._sendToDb (..../default/node_modules/derby/node_modules/racer/lib/Store.js:320:10)
    at Store.module.exports.bufferifyMethods.methodNames.forEach.Klass.(anonymous function) (..../default/node_modules/derby/node_modules/racer/lib/util/async.js:51:47)
    at writeToDb (..../default/node_modules/derby/node_modules/racer/lib/txns/txns.Store.js:102:15)
    at next (..../default/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
    at Object.Lww.incrVer (..../default/node_modules/derby/node_modules/racer/lib/modes/lww.js:33:12)
    at next (..../default/node_modules/derby/node_modules/racer/lib/middleware.js:7:26)
    at Object.module.exports.events.init.store.eachContext.context.guardWrite (..../default/node_modules/derby/node_modules/racer/lib/accessControl/accessControl.Store.js:50:45)
    at accessController (..../default/node_modules/derby/node_modules/racer/lib/txns/txns.Store.js:92:17)

Again, the code assumes my input is valid, and proceeds to fail deep within racer code.

@razic

/bump

@nateps

Being addressed in the re-write

@nateps

No longer relevant in 0.5

@nateps nateps closed this Jun 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment