-
Notifications
You must be signed in to change notification settings - Fork 509
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
Update return type of SDK promote method #538
Update return type of SDK promote method #538
Conversation
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.
Thanks for contribution @belemaire and yes - you are correct in your assumptions and service should always return promoted package instance if no errors are thrown.
I'm good with merging this.
👍 |
@max-mironov : Are you planning on publishing a new version of the SDK including this change soon ? We're waiting for this to release a new version of our platform. Thanks ! |
@belemaire sure, let's do it in the nearest days! |
Thanks @max-mironov ! 👍 |
@belemaire we have released new verison - https://github.com/Microsoft/code-push/releases/tag/v2.1.4. Thank you! |
Thanks @max-mironov for the quick release, greatly appreciated, have a good week :) |
@max-mironov FYI, don't know if that is intended, but there is a mismatch between the published version and the tag. |
Oh sorry, my bad, just realized it was the |
@belemaire yeah, there could be a little confusion here but 2.0.4 stands for SDK while 2.1.4 is for CLI. Thanks for attention to details 👍 |
In continuation to my previous PR #533, this PR updates the return type of the SDK
promote
method to return thePackage
object part of the server response instead of returningvoid
.Part of an ongoing project, calling in the CodePush SDK, we need the data resulting from the promotion.
It seems that the server call associated to
promote
will always return a body with a package object resulting from the promotion. Even the test was mocking a response with a package, so it seems that the server will always return a package response body in case of success.If not (I'm doubting it), what could be done is changing the return type to
Promise<Package|void>
and changing theexpectResponseBody
back to false, and return the response Package if present, otherwise don't return anything, and let the caller act accordingly.