Loopback: 2.36.2 version breaking replaceOrCreate method on User model

Created on 11 Jan 2017  ·  8Comments  ·  Source: strongloop/loopback

Bug or feature request

  • [x] Bug
  • [ ] Feature request

Description of feature (or steps to reproduce if bug)

Let's say database collection is empty and when invoking User.replaceOrCreate, getting error TypeError: Cannot read property 'email' of undefined

the line which causes this is here. originalUserData is an empty array(because db is empty) but it's assuming it has atleast one record.

Additional information (Node.js version, LoopBack version, etc)

LoopBack version: 2.36.2

team-apex

Most helpful comment

Hi @vijay22sai
There was a pr that fixed this issue by @bajtos recently. Are you still experiencing the same issue? Thanks

All 8 comments

@loay Can you please check this issue once. I could see the changes are done by you here https://github.com/strongloop/loopback/commit/d06190dae6b858e4da7b3ae91494e429f9adec66#diff-5d81af95449574544e7317f3eda2badeR680
Thanks.

Hi @vijay22sai
Thanks, I will have a look.

Hi @loay did you get a chance to have a look at this? We've very keen to upgrade to a later loopback release but this is holding us back at the moment.

Hi @vijay22sai
There was a pr that fixed this issue by @bajtos recently. Are you still experiencing the same issue? Thanks

Hi @loay, I will check it and let you know. Thanks a lot.

On Mar 7, 2017 10:10 PM, "Loay" notifications@github.com wrote:

Hi @vijay22sai https://github.com/vijay22sai
There was a pr that fixed this issue by @bajtos
https://github.com/bajtos recently. Are you still experiencing the same
issue? Thanks


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/strongloop/loopback/issues/3091#issuecomment-284778300,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABFEVgLMCzxZ-jyCb0BlSATv6O3vBawpks5rjYhngaJpZM4LgbJ1
.

Hi @loay I was able to upgrade to latest version 2.38.0 successfully without any issues. Thank you very much for the help 👍

Hey @loay just wanted to say thank-you for this - we're grateful for your assistance.

@vijay22sai @duncancasemore You guys are very welcome. I am glad I could help :) Thanks for your kind words

Was this page helpful?
0 / 5 - 0 ratings