zed/crates/cloud_api_client
Remco Smits 0f84a49e51
cloud_api_client: Move spawn native websocket to the background (#62874)
# Objective

While working on something else, I noticed that I sometimes get this
warning about a foreground hang:

```
2026-08-19T11:25:45+02:00 INFO [zed::reliability::hang_detection::logging] New foreground hang detected: Tasks(s) that ran too long 215.24375ms          - crates/cloud_api_client/src/websocket/native.rs:34:23
```

That I believe can just be safely moved to the background, unless I'm
missing something here.

## Solution

Spawn the websocket task on the background instead of on the foreground,
so that we can't hang the foreground thread anymore for **~200ms**.

## Testing

I have tested that I can still connect to the websocket, not sure what
else to test.

## 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:

- N/A

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2026-08-19 14:07:46 +00:00
..
src cloud_api_client: Move spawn native websocket to the background (#62874) 2026-08-19 14:07:46 +00:00
Cargo.toml cloud_api_client: Implement Wasm support (#61328) 2026-07-21 13:20:31 +00:00
LICENSE-APACHE Add cloud_api_client and cloud_api_types crates (#35357) 2025-07-30 18:57:51 +00:00