Comments (16)
@sviox Can you provide a sample repo for us to clone and reproduce the issue on our end?
from loopback-connector-redis.
@sviox Ping
from loopback-connector-redis.
@Setogit Might be an SG issue too, so you may want to take a look.
from loopback-connector-redis.
@sviox I got an error as well using the following steps:
- create 2.x loopback application with notes template
- create a
loopback-connector-redis
data-source and attach it to the Note model - populate the Note model
- delete by Id (using explorer) for an
id
that didn't exist - I had 500 return code on explorer - delete by id which existed - 200 return code
- delete by id which didn't exist and get:
| => node .
Web server listening at: http://0.0.0.0:3000
Browse your REST API at http://0.0.0.0:3000/explorer
/Users/badmike/redisapp/node_modules/redis/index.js:602
throw err;
^
TypeError: Cannot read property 'id' of null
at /Users/badmike/redisapp/node_modules/loopback-connector-redis/lib/redis.js:635:61
at /Users/badmike/redisapp/node_modules/loopback-connector-redis/node_modules/async/lib/async.js:567:21
at /Users/badmike/redisapp/node_modules/loopback-connector-redis/node_modules/async/lib/async.js:246:17
at /Users/badmike/redisapp/node_modules/loopback-connector-redis/node_modules/async/lib/async.js:122:13
at _each (/Users/badmike/redisapp/node_modules/loopback-connector-redis/node_modules/async/lib/async.js:46:13)
at async.each (/Users/badmike/redisapp/node_modules/loopback-connector-redis/node_modules/async/lib/async.js:121:9)
at _asyncMap (/Users/badmike/redisapp/node_modules/loopback-connector-redis/node_modules/async/lib/async.js:245:13)
at Object.map (/Users/badmike/redisapp/node_modules/loopback-connector-redis/node_modules/async/lib/async.js:216:23)
at _parallel (/Users/badmike/redisapp/node_modules/loopback-connector-redis/node_modules/async/lib/async.js:565:20)
at Object.async.parallel (/Users/badmike/redisapp/node_modules/loopback-connector-redis/node_modules/async/lib/async.js:595:9)
at /Users/badmike/redisapp/node_modules/loopback-connector-redis/lib/redis.js:637:13
at /Users/badmike/redisapp/node_modules/loopback-connector-redis/lib/redis.js:613:9
at /Users/badmike/redisapp/node_modules/loopback-connector-redis/lib/redis.js:111:38
at /Users/badmike/redisapp/node_modules/loopback-connector-redis/lib/redis.js:97:9
at try_callback (/Users/badmike/redisapp/node_modules/redis/index.js:592:9)
at RedisClient.return_reply (/Users/badmike/redisapp/node_modules/redis/index.js:685:13)
I tried the same steps using a spanish locale to get strong-globalize involved but I get the same error.
version info:
___________________ | ~/espanolapp @ Biniams-MacBook-Pro (badmike)
| => npm -v
3.10.10
___________________ | ~/espanolapp @ Biniams-MacBook-Pro (badmike)
| => node -v
v4.6.0
___________________ | ~/espanolapp @ Biniams-MacBook-Pro (badmike)
| => slc -v
strongloop v6.0.3 (node v4.6.0)
├── [email protected] (3dd25ac)
├── [email protected] (a98f310)
├── [email protected] (9b29df0)
├── [email protected] (62e539b)
├── [email protected]
├── [email protected] (f8c2339)
├── [email protected] (28c261d)
├─┬ [email protected]
│ └── [email protected] (b51fc45)
├── [email protected] (6a0e2c0)
├── [email protected] (16841d6)
└── [email protected]
from loopback-connector-redis.
Thank you b-admike for providing an example. My app was a bit complicated to strip down so I would have needed to create basically an empty application to demonstrate it just like you did.
from loopback-connector-redis.
You're welcome @sviox.
from loopback-connector-redis.
@b-admike I have a fix, if you can give it a test please. I tested it myself, and it works.
from loopback-connector-redis.
@gclyne I have tested your fix and while my app doesn't crash, it still returns 200 status code and an empty array for the ids which don't exist. If that is the expected behaviour, then we are golden.
EDIT: I have also tested the same steps with a mongoDB datasource and besides returning the count of rows deleted, the status code is still 200 for both existing and non-existing ids. Thus, IMO, the behaviour is correct.
from loopback-connector-redis.
@b-admike Cool, so is it ok to go ahead and merge this fix or is there anyone else who should review this? @superkhau?
from loopback-connector-redis.
@gclyne I think it is safe to merge. @superkhau can pitch in. @sviox can you also try the fix?
from loopback-connector-redis.
@gclyne I responded in the PR, can you add some tests? Should be able to land/release right after that is done.
@b-admike Can you do the initial review in the PR and ping me to do a final review? PTAL at https://github.com/strongloop-internal/loopback-knowledge-base/blob/master/triaging-pull-requests.md
from loopback-connector-redis.
cc @strongloop-community/loopback-managers We need a sprint 27 milestone for strongloop-community also.
from loopback-connector-redis.
@b-admike Please fill in the assignees, estimates, etc yourself next time, same for the corresponding fix PR.
from loopback-connector-redis.
Will do @superkhau and since the change is reviewed and merged, this issue can be closed as soon as @sviox also verifies it. We might also be able to close #44 since it seems like a related issue.
from loopback-connector-redis.
@b-admike Can you own the above? Feel free to close this issue after verifying with @sviox and close #44 after referencing the PR I landed or this issue for posterity.
from loopback-connector-redis.
@sviox I am closing this issue because I have verified the fix. However, if you see it again after using the master version of this repo (until next release), then we can investigate further. I have created a repro app here that you can use.
from loopback-connector-redis.
Related Issues (20)
- Docs HOT 2
- Support ioredis HOT 1
- "TypeError: Cannot read property 'package' of undefined" while adding datasource HOT 3
- No indexes found for <fieldname> impossible to sort and filter using redis connector HOT 10
- `database` will cause error HOT 3
- Use ESLint instead of JSHint HOT 1
- Re-enable test cases
- "idInjection": false doesn't work
- Where filter not working. HOT 7
- Upserting an existing records returns all fields as strings HOT 2
- The function destroyAll fails with error HOT 4
- crashes the application on connection-errors HOT 1
- Error: ERR wrong number of arguments for HMSET
- strong-globalize can't process error object
- Bad value stored for a foreign key that is a string. HOT 1
- Lost relation between AccessToken and User when using AccessToken stored in redis HOT 3
- Broken CLA Link HOT 1
- How to set Redis database number? HOT 2
- Is the transactional feature implemented ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loopback-connector-redis.