Skip to content

Promisify User model - #1493

Merged
bajtos merged 1 commit into
strongloop:masterfrom
PradnyaBaviskar:issue418-userModel
Aug 4, 2015
Merged

Promisify User model#1493
bajtos merged 1 commit into
strongloop:masterfrom
PradnyaBaviskar:issue418-userModel

Conversation

@PradnyaBaviskar

Copy link
Copy Markdown
Contributor

Connect #418

Comment threadtest/user.test.js

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this test, User.login throws "Unhandled rejection Error: login failed". And so, when executing the test it says "Cannot call method 'then' of undefined". Whereas, https://github.com/strongloop/loopback/pull/1493/files#diff-5d81af95449574544e7317f3eda2badeR259, correctly returns fn.promise

@bajtos - can you help me?

@pulkitsinghal

Copy link
Copy Markdown

@PradnyaBaviskar It would seem that the loopback team intentionally limited the promisification to CRUD methods

@pulkitsinghal wrote: So the CRUD methods for models and relatedModels now use promises ... but something like User.login() still does not ... correct?

@bajtos wrote: Yes, that's a correct description of the current status.

But that doesn't mean we shouldn't get the other ones also promisified, thanks for opening this, +1

Comment threadcommon/models/user.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the app variable defined? Perhaps this is throwing an error that is later converted to the error message you are seeing?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, are you relying on the fact that test/support.js is setting up a global app variable?

@bajtosbajtos self-assigned this Jul 2, 2015
@PradnyaBaviskar
PradnyaBaviskarforce-pushed the issue418-userModel branch 2 times, most recently from ebef568 to 6113eefCompareJuly 14, 2015 07:13
@PradnyaBaviskar

Copy link
Copy Markdown
ContributorAuthor

Done with promisifying User model.

@raymondfeng, can you please review?
/cc @bajtos

@bajtos

Copy link
Copy Markdown
Member

@slnode test please

bajtos added a commit that referenced this pull request Aug 4, 2015
@bajtos
bajtos merged commit aa5c9e3 into strongloop:masterAug 4, 2015
@bajtos

Copy link
Copy Markdown
Member

Landed, thank you for the contribution!

@bajtos

Copy link
Copy Markdown
Member

FWIW, the Jenkins build is failing due to an issue that was fixed on master by 34eb0e1

@coodoocoodoo mentioned this pull request Aug 6, 2015
32 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@PradnyaBaviskar@pulkitsinghal@bajtos@altsang