# Fix hanging updates after system sleep \(\#60301\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 2882636c06923e58d83865ecc370bd0d8199d738

Requested commit: 2882636c06923e58d83865ecc370bd0d8199d738

Commit: 2882636c06923e58d83865ecc370bd0d8199d738

Tree: 45a56f1b2b7a4a60c85b087eba6fa2f85daf98d1

Author: Anthony Eid

Committer: GitHub

## Message

```
Fix hanging updates after system sleep (#60301)

When Zed was downloading an update and the machine went to sleep, the
download would hang indefinitely on wake because the in-flight TCP
connection had silently died and nothing ever timed it out or retried.
This adds an inactivity `read_timeout` to the HTTP client so a stalled
response body errors out instead of hanging forever
(slow-but-progressing downloads are unaffected, since the timeout resets
on each chunk). It also promotes `App::on_system_wake` to a
multi-subscriber `Subscription` API and uses it in the auto-updater to
cancel an interrupted check/download on wake and start a fresh attempt.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fix hanging Zed update downloads after system sleep
```

## Parents

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

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