Moonshine-IDE / Moonshine-SDK-Installer

To take full advantage of Moonshine IDE you will need third party SDKs like Apache® Flex or Apache® Royale. In order to make it easier for you to setup the required SDKs, we created the Moonshine SDK Installer.
https://moonshine-ide.com/download-sdk-installer/
Other
8 stars 2 forks source link

Safely Replace Nightly Build #35

Closed JoelProminic closed 3 years ago

JoelProminic commented 3 years ago

I'm spliting this issue from #34. See: https://github.com/prominic/Moonshine-SDK-Installer/issues/34#issuecomment-780026984

For the safe nightly build replacement, @rat-moonshine's design works like this;

1. User already has a nightly build downloaded apache-royale-0.9.8-bin-js

2. User asks for a new nightly build

3. MSDKI verifies that the download linke is invalid

4. MSDKI deletes the existing apache-royale-0.9.8-bin-js folder

5. MSDKI starts a newer download

6. MSDKI extracts the download and does any additional installation steps

However, if there is a different error in steps 5 or 6 (for example, the download is interrupted by a network issue), the user would still be left without a working nightly build.

My suggestion is to install to a temporary directory, and then only delete the original once the new install finished succesfully:

1. User already has a nightly build downloaded apache-royale-0.9.8-bin-js

2. User asks for a new nightly build

3. MSDKI downloads the new nighlty build into a temporary directory

4. MSDKI extracts the download and does any additional installation steps
   5a. If the install was successful, delete the old installation and rename the new installation to replace it
   5b. If the install failed, delete the temporary installation and keep the old installation

In this case, the installation would only be invalid if something went wrong with the rename in step 5a.

This logic should not be necessary for the Stable installers. If the user is installing here, then either:

* The SDK was not installed before, so the user is not worse off if there is an error in the installation

* And older version of the SDK was installed, so the user can keep using that if there is an error.
rat-moonshine commented 3 years ago

While testing the disconnect scenario (to support "5b. If the install failed, delete the temporary installation and keep the old installation"), I see I'm in struggle to get an error callback from the using Apache archive-downloader util class where the using URLLoader failing to return a notification.

So far it's still failing, I'm trying to find out how to get a network error event out of it.

JoelProminic commented 3 years ago

I think this issue is resolved, but we need to revisit and document the testing. I thought we had a test matrix for this already, but I don't see it.

piotrzarzycki21 commented 3 years ago

@rat-moonshine Maybe it's worth to do not spend more time on it. In general we have now checking whether link is working and this should be enough. SDK won't be removed when user have some problems with downloading - that was the idea nd it's working fine as far as I know.

rat-moonshine commented 3 years ago

Yeah, I'm less hopeful to have any return in the current working's of the URLLoader API. I think I started working on some alternative way to determine a possible error, but I don't remember now where I left the idea.

JoelProminic commented 3 years ago

We tested the current code for a failed connection to the download server, but we don't have way to detect or test other other problems with the download. We are planning to move this logic to Haxe anyway, so it is not worth spending more time on this for now.