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

Await the saveConfig #570

Merged
merged 3 commits into from
Aug 19, 2021
Merged

Await the saveConfig #570

merged 3 commits into from
Aug 19, 2021

Conversation

nohe427
Copy link
Collaborator

@nohe427 nohe427 commented Jul 22, 2021

This fixes a bug where the AndroidSDK could be downloaded twice because the config was not being saved if an invalid manifest was supplied. Adding the await will wait for the saveConfig method to finish before continuing execution.

This fixes a bug where the AndroidSDK could be downloaded twice because the config was not being saved if an invalid manifest was supplied. Adding the await will wait for the saveConfig method to finish before continuing execution.
Copy link
Collaborator

@PEConn PEConn left a comment

Choose a reason for hiding this comment

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

So I can see the "adding await" part to your solution, but I'm not sure how this prevents multiple downloads from happening?

@andreban
Copy link
Member

I think there may be a very short space of time where the JDK has been installed, the config hasn't been saved, and the application is killed before it is saved. Then, running the application again will reinstall the JDK. This should be quite uncommon though, and I'm not sure adding await would fix it. Adding await here is unlikely to have bad side effects, but I'm not sure it is needed too, since saveConfig() doesn't change the config in and persisting to disk can be happen asynchronously.

@nohe427
Copy link
Collaborator Author

nohe427 commented Jul 22, 2021

The issue for me wasn't the JDK getting installed twice, but the Android SDK. What I did to get this error was I went and called :
bubblewrap init --manifest <domain>/manifest.json and did not supply the https protocol. After installing the Android SDK, the request failed for the manifest as it wasn't a valid URL and when I called bubblewrap init... with the right parameters, then the download restarted for the android sdk. I realize this is a bit of an edge case, but I happened to cut myself on this one last night.

Copy link
Member

@andreban andreban left a comment

Choose a reason for hiding this comment

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

LGTM

@nohe427 nohe427 merged commit 53966cf into main Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants