hubotio / hubot-redis-brain

A hubot script to persist hubot's brain using redis
69 stars 55 forks source link

Unix sockets always have a nonsense prefix of `[object Object]` #33

Closed jonesetc closed 7 years ago

jonesetc commented 7 years ago

https://github.com/hubotio/hubot-redis-brain/blob/b21dedf8e15717781f8f0ff91936c65234485b19/src/redis-brain.js#L34-L38

Because the URL is being parsed with parseQueryString as true, even a blank querystring will be an object. An object is never falsey, and calling .toString() will always return [object Object]. This would be solved by just passing false as the second argument (or omitting) to Url.parse().

jonesetc commented 7 years ago

I have fixed and tested this with the old version which I'm trying to use, here's the simple example: https://github.com/quartethealth/hubot-redis-brain/commit/25da6494a01dd48f4331ea13936ce2627d523495

I can submit a PR for master if you want, but it is a very small fix.

mose commented 7 years ago

Thanks! I will do the change, no need for hassle :)

jplindquist commented 6 years ago

Do you have a release coming with this fix at all? I just started running into this trying to using redis-brain with a redis socket and was looking for exactly this

TypeError: info.query.toString is not a function
github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 1.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: