-
Notifications
You must be signed in to change notification settings - Fork 577
Events are triggered sequentially when the handlers execute async code #1768
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
Conversation
ricardograca
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mostly ok. There's just a small issue with the test that should be fixed.
test/integration/model.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind returning the call to save() here instead of calling ok() at the end? This ensures better consistency with the rest of the test suite and if the test fails the error will get caught correctly instead of being handled by the generic global onPossiblyUnhandledRejection() handler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will update 👍
test/integration/model.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You call the events "async", but they seem more sync now since the next listener is only called after the first one resolves, so can you explain the async nature of this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will update 👍
Thanks for review. Will update as soon as possible. |
|
@ricardograca I've pushed a commit with your suggestions. Ready to squash + merge if you are ok with it 👍 |
|
@ricardograca Hey. is there any chance that this get's released by the end of this week? 😁 |
|
I'd say probably not, but it won't be much later after that. There are still 3 issues left in the project for the next version, although I'm already looking into the table alias one. You can go ahead and merge all of your approved PRs though. |
👍 |
5ebe4f7 to
d902e1c
Compare
closes bookshelf#1765 - `triggerThen` was running in parallel before - event handlers were executed at the same time - that means you can't rely on an operation (or a change) which a previous handler executed - use `mapSeries` instead - added a test
d902e1c to
dabce13
Compare
Till Monday would be very, very, very helpful. Ghost wants to ship a feature beginning of next week and i would love to avoid using a tarball link or a fork 😁 Thanks in advance! |
|
Ok, if I'm unable to finished reviewing, merging and/or refactoring the last remaining PRs by Saturday I'll just move them to the next version and start preparing version 0.13.0 from what's already done which is already substantial. |
- i discovered two bookshelf bugs on 0.10.3 - bookshelf/bookshelf#1769 - bookshelf/bookshelf#1768 - we are currently locked to 0.10.3, because we saw a connection problem when updating to the latest knex+bookshelf - using a tarball can trouble when installing deps - we saw this in the past - e.g. you have bookshelf already installed - now you switch to a tarball - neither yarn, nor npm are able to replace the dep - require bookshelf-0.10.3
closes #1765