Repository navigation
Commit 7f4e5f6
fix: stop making the user press twice, and let Blox AI find the Blox (#32)
Two defects behind three field reports, both of the same shape: the first
attempt fails, the second works.
1. A stale certhash cost the user a click, every time.
Opening the plugins screen and installing a plugin both go over libp2p, and
both reported a "certificate" failure on the first try and succeeded on the
second. `FulaClient.ensureConnected` was doing:
if (err.code === 'NO_CERTHASH') this.refreshDiscovery = true;
throw err;
-- refresh NEXT time, and rethrow now. So the first action after a relay
rotated its WebTransport certificate always failed, and the retry the user
was owed only happened because they pressed the button again. kubo rotates
those certs on a 14-day cycle and advertises current AND next, so a stale
hash is routine, not exceptional.
It now refreshes discovery and redials once, immediately. `retriedCerthash`
keeps it to a single extra attempt, never a loop against a relay that is
genuinely unreachable.
2. Blox AI could not find a Blox on the same switch.
"Cannot reach your Blox over the local network or Bluetooth" on a Blox that
answers ping, on the same LAN. `selectAiTransport` had four LAN tiers --
fresh cache record, typed IP, remembered address, and a `refreshOnce` that
asks discovery /find-box for private ip4 entries. That last one needs
fula-ota PR-D and returns nothing today, which its own comment says. So a
browser with no remembered address and no typed IP had literally nothing
left to try and fell through to BLE.
Meanwhile the setup screen's own search finds that Blox in seconds. This
adds it as a tier: candidate .local names plus a subnet sweep, reading each
answer's peer id from blox-ai /diag/relay. That peer id is a STRONGER check
than the /health probe the other tiers use -- the address is only used if
the box behind it says it is the one we mean, so a private address pointing
at a stranger on another network is rejected before anything is sent to it.
A found IPv4 address is written back, so the next session takes the
remembered tier and never pays for the scan again.
Verified: 937 unit tests, tsc --noEmit clean on both the app and the client
package, eslint clean.
Not addressed: whether the first plugin-screen error was the same certhash
failure. It was never read -- the report is "an error I couldn't see" -- so
that is inference from the shape, not evidence.
Claude-Session: https://claude.ai/code/session_01YJyqpFReP1wbz86nsqsoXq
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent e35f3a7 commit 7f4e5f6
3 files changed
Lines changed: 147 additions & 4 deletions
File tree
- apps/fxblox-web/src/utils
- __tests__
- packages/fula-web-client/src/core
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
| |||
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| 27 | + | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
| 32 | + | |
| 33 | + | |
26 | 34 | | |
27 | 35 | | |
28 | 36 | | |
| |||
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
| 54 | + | |
| 55 | + | |
46 | 56 | | |
47 | 57 | | |
48 | 58 | | |
| |||
349 | 359 | | |
350 | 360 | | |
351 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
126 | 136 | | |
127 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
128 | 141 | | |
129 | 142 | | |
130 | 143 | | |
| |||
142 | 155 | | |
143 | 156 | | |
144 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
145 | 202 | | |
146 | 203 | | |
147 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
264 | 271 | | |
265 | 272 | | |
266 | 273 | | |
| |||
330 | 337 | | |
331 | 338 | | |
332 | 339 | | |
333 | | - | |
334 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
335 | 357 | | |
336 | 358 | | |
337 | 359 | | |
| |||
0 commit comments