Repository navigation
Commit 502f738
committed
remove RobotClient.async_client property to eliminate cross-loop foot-gun
The property returned self._inner — the AsyncRobotClient bound to
RobotClient's private background loop. Reaching for it from another loop
and awaiting one of its methods produced a cryptic "Queue is bound to a
different event loop" deep inside _request_ok_raw.
Worse, _run()'s error message steered users toward the trap: "use
AsyncRobotClient and `await` the method instead" got read as "grab the
one hanging off my sync client" rather than "construct a fresh one in
this loop."
- Delete the async_client property (zero non-test callers across this
repo and Waldo-Commander; re-added in 8cc47dc as part of a typed-stub
revert).
- Tighten _run()'s error message to point at constructing a fresh
AsyncRobotClient in the calling loop.
- Update the two test sites that monkeypatched client.async_client._request
to use client._inner._request directly — they were already patching a
private method, so the change is honest.1 parent ea4afc9 commit 502f738
2 files changed
Lines changed: 3 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | 169 | | |
175 | 170 | | |
176 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
0 commit comments