Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling save in get callback crash sometimes. #64

Closed
manast opened this issue May 17, 2011 · 7 comments
Closed

calling save in get callback crash sometimes. #64

manast opened this issue May 17, 2011 · 7 comments

Comments

@manast
Copy link

manast commented May 17, 2011

I am running an example code which is identical to the one on the webpage:
db.get('flights', 'KLM-5034', function(err, flight, meta) {
if (err) throw err
flight.status = 'delayed'
meta.links.push({ bucket: 'airlines', key: 'IBE', tag: 'operated_by' })
db.save('flights', 'KLM-5034', flight, meta)
})

But I got almost all the time the following error ( very seldom it works without error ):

/node_modules/riak-js/lib/utils.js:84
target[k] = d.value; ^
undefined

Any clues what is happening here?

thanks!.

@frank06
Copy link

frank06 commented May 18, 2011

that's odd. i'll check it as soon as i can. in the meantime: which versions of riak-js and node are you using?

@manast
Copy link
Author

manast commented May 18, 2011

Im using riak 0.14 for Mac Os ( which is very unstable I must say ), Node 0.5.0pre and riak-js 0.4.0rc2

@manast
Copy link
Author

manast commented May 18, 2011

I can share with you my exact code. I removed even the meta.links.push and also updating the returned "flight" ( in my case it is a display ). I get the same exact error:

app.put('/displays/:displayId/playlist/:playlistId', function(req, res){
var displayId = req.params.displayId;
var playlistId = req.params.playlistId;

db.get('displays', displayId, function(err, display, meta) {
if ( err)
{
console.log(err);
res.statusCode = 400;
res.send(http.STATUS_CODES[res.statusCode]);
}
else
{
db.save('displays', displayId, display, meta);
res.send('OK');
}
});
});

@luccastera
Copy link
Contributor

+1

I've been seeing a similar behavior. The error gets thrown within Utils.mixin.

@frank06
Copy link

frank06 commented May 21, 2011

right. actually #67 turns out to be a duplicate of this issue, but i'll be closing this one. 4879680 should fix it. i plan to release today.

@frank06 frank06 closed this as completed May 21, 2011
@manast
Copy link
Author

manast commented May 21, 2011

That was really good news, since I was already implementing this directly on top of Riak's HTTP API as a workaround :).

@manast
Copy link
Author

manast commented May 21, 2011

I tested it with the new release and the problem is solved. Good Job!! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants