# extension_host: Make extension updates more resilient \(\#54355\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/5bc4243182a9aefdf675b8e7db7488024c02cd78)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 5bc4243182a9aefdf675b8e7db7488024c02cd78

Requested commit: 5bc4243182a9aefdf675b8e7db7488024c02cd78

Commit: 5bc4243182a9aefdf675b8e7db7488024c02cd78

Tree: 9f0ed05fb8168c23e66c74c2c05bfa51bef821e8

Author: Finn Evers

Committer: GitHub

## Message

```
extension_host: Make extension updates more resilient (#54355)

Following our incident earlier, I noticed a report that mentioned their
extension was uninstalled upon update which made them stumble across the
issue for our outage.

The reason for this was that currently, whenever we install extension
updates, we _first_ removed the old directory and _then_ went ahead and
downloaded the new version. This would in turn obviousy lead to issus
where something malfunctioned during the update/install download -
whether that is an issue on our side with the servers or an issue on the
users side when they have a poor network connection or lose that.

This PR changes this - we now do the entirety of the download on a
background task, unpack the archive into a temporary directory if
possible and then proceed with removing the old extension contents and
moving the new contents only _after_ everything prior succeeded.

I also moved this off of the main thread since there is no reason to do
this there as well as the `Drop` impl of a `TempDir` doing some blocking
work on the main thread otherwise.

Release Notes:

- Made extension updates more resilient to network and upstream failures
```

## Parents

- [177b2d5e9ea18674ceb09ef1544e656efda540f8](https://git.cafe/gitcafe/zed/commit/177b2d5e9ea18674ceb09ef1544e656efda540f8?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/5bc4243182a9aefdf675b8e7db7488024c02cd78?format=markdown)
