Permalink
Browse files

Fixed SessionStore bug: store.get was calling callback with (err,null…

…) when it should call it with no parameters (err being undefined) when it doesn't find the session in riak. See connect's MemoryStore implementation for reference: https://github.com/senchalabs/connect/blob/master/lib/middleware/session/memory.js
  • Loading branch information...
1 parent d65a2fc commit 5f5fda48988d980fead8c1a8647f96137c3e06cd @luccastera luccastera committed May 5, 2011
Showing with 2 additions and 3 deletions.
  1. +1 −2 spec/test_session_store.coffee
  2. +1 −1 src/session_store.coffee
View
3 spec/test_session_store.coffee
@@ -43,8 +43,7 @@ suite.addBatch
store.get 'frank', @callback
undefined
'successfully': (err, data) ->
- assert.isNotNull err
- assert.equal err.errno, process.ENOENT
+ assert.isUndefined err
assert.isUndefined data
suite.addBatch
View
2 src/session_store.coffee
@@ -18,7 +18,7 @@ class SessionStore extends Store
if meta.statusCode >= 400 && meta.statusCode < 500
err.errno = process.ENOENT
- cb(err, null) if cb
+ cb() if cb
else
cb(null, data) if cb

0 comments on commit 5f5fda4

Please sign in to comment.