# fix\(relay\): let preview teardown finish when zone or tunnel is already gone · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/5d543a26735a081b5130cb5cf763fa73c3d31b80)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: 5d543a26735a081b5130cb5cf763fa73c3d31b80

Requested commit: 5d543a26735a081b5130cb5cf763fa73c3d31b80

Commit: 5d543a26735a081b5130cb5cf763fa73c3d31b80

Tree: b1d63e22c0874ee9e1bc0a55a265c2ab813df04f

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
fix(relay): let preview teardown finish when zone or tunnel is already gone

A missing zone raised before any tunnel was checked, so it blocked teardown
even with no tunnels left. The sweep now skips the zone lookup when nothing
remains, and still removes tunnels when the zone is gone. A 404 on delete counts
as swept; any other failure, such as a 429, still fails so the next run retries.
Covered by tests that drive the sweep through a stubbed Cloudflare client.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>

```

## Parents

- [e06f4f7a812a8318fd958df07b9590b648f2c4a7](https://git.cafe/pingdotgg/t3code/commit/e06f4f7a812a8318fd958df07b9590b648f2c4a7?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/5d543a26735a081b5130cb5cf763fa73c3d31b80?format=markdown)
