Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes the bug NCP-3115.
When users press “Update all apps” sometimes an error message “Unable to load apps” was shown (even though it worked correctly).
This was caused by a race condition: When one app was completely upgraded it reloaded the state of all apps but another one was possible in the middle of being upgraded, which could lead to it's app folder being transiently in an inconsistent state. E.g. while deleting the old version, the
package.json
was already gone but the folder still existed.To fix this, when removing the old version of the app, the app folder is first moved to different, temporary folder and the contents are removed there. When installing the new version it is done the other way around: The downloaded app is first unpacked to a temporary folder and afterwards the whole folder is moved to the final destination.
This PR bumps the version up to 3.4.2, but from my point of view this small fix alone does not yet justify doing a release. We can wait for the next thing that should also be released.
This change also makes it possible, that we could allow users to start multiple installs, upgrades or removals in parallel, but I will do that change in a different PR. Currently the UI state can be slightly broken in that regard anyhow: After users click on “Update all apps” all install/upgrade/remove buttons are temporarily disabled but as soon as the first upgrade is finished all buttons (including “Update all apps”) are enabled again.