mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 23:18:24 +00:00
wait_for_event_on_relay built a fresh client on every poll, called `Client::connect`, and slept 100 ms per status check before each fetch. Every poll therefore cost a new WebSocket handshake plus at least one fixed interval, and a missed status transition stalled a poll for a full second. TestClient::connect used the same sleep-first loop. Keep one connection for the whole wait and use `connect_client`, which awaits the connection attempt through `try_connect`; poll the fetch at the existing 200 ms interval with the existing 500 ms fetch window. Have TestClient::connect use `try_connect` directly so a failed attempt returns the SDK's reason instead of a generic timeout. Negated callers that observe absence over a window keep their semantics: the helper still returns false when nothing matched before the deadline. Validation: `cargo check -p ngit-grasp --tests`; callers are covered by the relay_identity and sync binaries measured in the following commits. Assisted-by: Claude Fable 5.1 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>