-
Notifications
You must be signed in to change notification settings - Fork 2.3k
1.2.0: .nodeify doesn't return a promise #168
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
Comments
This is to prevent people from using callbacks and promises at the same time |
Isn't it what documentation says here: https://github.com/petkaantonov/bluebird/blob/master/API.md#nodeifyfunction-callback---promise
It is also a breaking change for projects that were exporting both interfaces. How is it possible that such breaking change is made without any acknowledgements in minor version upgrade? |
I see that it returns undefined only in the presence of callback, but it still breaks hundreds of tests people may had in their projects: checking for both valid promise and called callback. Now each test should be duplicated. You had only 1 'unintuitive' issue report now you have broken dependant projects. |
In a line - it didn't work too well before. In my opinion - a dual interface is a mistake and opens up all sorts of problems, especially given how simple (and fast!) it is to promisify a node interface, or nodeify a promise based one. You can always support a promise interface and tell users who want callbacks to That said, I fully see why this change upsets you, we try to make as few such breaking changes as possible but sometimes we realize an API mistake was made. Sorry. |
I think we can quickly fix this in a patch.. 2.0 will come soon anyway |
Yeah, sorry I was too much upset. I agree that this is correct behaviour. That's just that I need to fix about 1000 tests in my projects. |
Yes I did not realize anyone was actually relying on this behavior - I take backwards compatibility very seriously so I will fix this asap in a patch. |
I actually think that both interfaces can only be used in such limited cases as tests (just to save typing and copy/pasting). So - you decide. |
@petkaantonov |
It makes no sense to use both interfaces simultaneously so probably nothing |
So, I can still export both interfaces, but only one can be used, right?
|
Hi!
I noticed
.nodefiy
doesn't return a promise back in 1.2.0:The text was updated successfully, but these errors were encountered: