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

fix issue where start will never resolve if droplet has been deleted #407

Merged
merged 4 commits into from
May 13, 2016

Conversation

trevj
Copy link
Contributor

@trevj trevj commented May 12, 2016

Currently, the start method assumes that it can fetch the details of a droplet it's just created - that was originally a reasonable approach but not since we introduced cancellation. I believe this partially addresses:
UWNetworksLab/uProxy-p2p#2397


This change is Reviewable

this.state_.network['ipv4'] = resp.droplet.networks.v4[i].ip_address;
for (var i = 0; i < droplet.networks.v4.length; i++) {
if (droplet.networks.v4[i].type === 'public') {
this.state_.network['ipv4'] = droplet.networks.v4[i].ip_address;
Copy link

Choose a reason for hiding this comment

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

can we break out of this loop once we set this here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! Some functional programming approach would be even better...but can wait.

@jab
Copy link

jab commented May 13, 2016

Very nice changes. (Two totally-safe-to-ignore nit-questions so) 👍

@jab
Copy link

jab commented May 13, 2016

(Just for my own understanding, the main change I saw here is to deal with the droplet value directly rather than wrapping it in an object like {droplet: droplet}. But I can't tell why that would fix the issue where start won't resolve if the droplet has been deleted. Can you point me toward where that makes the critical difference?)

@trevj
Copy link
Contributor Author

trevj commented May 13, 2016

Quite right, I didn't explain: previously, start made a GET call to /droplets and (erroneously) assumed the response would have a droplets field - getDroplet_ makes no such assumption. Basically, yay utility functions :-)

@trevj trevj force-pushed the trevj-cloud-install-getdroplet-fix branch from 9899726 to cf3e83b Compare May 13, 2016 19:59
@trevj trevj merged commit e8af960 into master May 13, 2016
@trevj trevj deleted the trevj-cloud-install-getdroplet-fix branch May 16, 2016 13:50
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