Skip to content

Conversation

@code-asher
Copy link
Member

Rename the old directory with a timestamp before moving the new directory into place.

Also has a minor fix for a notification saying the update failed when it didn't (isLatest
won't be true since that version is still technically the older version).

Fixes #1483 .

@code-asher code-asher requested a review from nhooyr as a code owner April 2, 2020 21:25
+ }
+
+ const json = await response.json();
+ if (!json.isLatest) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this cause no errors to be reported if an update fails?

Copy link
Member Author

Choose a reason for hiding this comment

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

The response will only be a 200 if the update succeeded so it should already have bailed out on the line above. The problem with this line is that isLatest was always false since the currently running code was still the old version.

Although, that means I should log the status text and not just "unexpected response". Will do that right now.

@code-asher code-asher merged commit d2a3147 into master Apr 2, 2020
@code-asher code-asher deleted the update-backup branch April 2, 2020 22:28
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.

code-server deletes olds version when updating

2 participants