# Keep a capture's shared download client open until the capture ends \(\#232\) · dara/icarus

[View on GitCafe](https://git.cafe/dara/icarus/commit/9adbbe24beb3a4b88b824432be1e0051b48e1d09)

Repository: [dara/icarus](https://git.cafe/dara/icarus)

Visibility: public

Requested revision: 9adbbe24beb3a4b88b824432be1e0051b48e1d09

Requested commit: 9adbbe24beb3a4b88b824432be1e0051b48e1d09

Commit: 9adbbe24beb3a4b88b824432be1e0051b48e1d09

Tree: 391142a8a796f92bd8d247c3ff0908dd2caf5bed

Author: Dara Adedeji

Committer: GitHub

## Message

```
Keep a capture's shared download client open until the capture ends (#232)

A capture's downloads shared one client through http.runWithClient so a
failed capture could abort the rest. But package:http's top-level get
closes whatever client it picked up when its request finishes, so the
first finished download closed the shared client: in a browser that
aborts the other downloads in flight and refuses a refresh after an
expired URL, and a screenshot of a page with two or more cloud images
failed with "Couldn't load the images on this page."

The fetcher now receives the capture's client and downloadCloudImageBytes
calls client.get on it, so only the capture closes it, once it is done.
A test serves three images (one refreshed after an expired URL) through
a client that, like BrowserClient, refuses requests once closed; it
fails with the old behaviour.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
```

## Parents

- [5424d767d036f3ff4be3466c8a81c8a401175983](https://git.cafe/dara/icarus/commit/5424d767d036f3ff4be3466c8a81c8a401175983?format=markdown)

[Source at this commit](https://git.cafe/dara/icarus/tree/9adbbe24beb3a4b88b824432be1e0051b48e1d09?format=markdown)
