Skip to content
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

Merged
merged 1 commit into from
Nov 23, 2017

Conversation

belemaire
Copy link
Contributor

In continuation to my previous PR #533, this PR updates the return type of the SDK promote method to return the Package object part of the server response instead of returning void.

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 the expectResponseBody back to false, and return the response Package if present, otherwise don't return anything, and let the caller act accordingly.

@max-mironov max-mironov self-requested a review November 22, 2017 07:44
Copy link
Contributor

@max-mironov max-mironov left a 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.

@belemaire
Copy link
Contributor Author

👍

@max-mironov max-mironov merged commit 66c0d8e into microsoft:master Nov 23, 2017
@belemaire
Copy link
Contributor Author

@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 !

@max-mironov
Copy link
Contributor

@belemaire sure, let's do it in the nearest days!

@belemaire
Copy link
Contributor Author

Thanks @max-mironov ! 👍

@max-mironov
Copy link
Contributor

@belemaire we have released new verison - https://github.com/Microsoft/code-push/releases/tag/v2.1.4. Thank you!

@belemaire
Copy link
Contributor Author

Thanks @max-mironov for the quick release, greatly appreciated, have a good week :)

@belemaire
Copy link
Contributor Author

@max-mironov FYI, don't know if that is intended, but there is a mismatch between the published version and the tag.
2.0.4 is the latest published version while 2.1.4 is the tag.
That's OK, I noticed it and picked 2.0.4 but it might seem confusing to other people.
It seems like it's not the first version for which this is the case where minor digit is different.

@belemaire
Copy link
Contributor Author

Oh sorry, my bad, just realized it was the CLI version that was tracked by tags, not the SDK version. CLI is what matters to most users so I guess it's OK ;)

@max-mironov
Copy link
Contributor

@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 👍

Sign up for free to 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.

2 participants