()
| 204 | if (note) degraded = note.reason; |
| 205 | }, |
| 206 | error() { |
| 207 | connected = false; |
| 208 | // Take the closer before calling it: a transport that calls `error` |
| 209 | // again from inside its own teardown must not re-enter this. |
| 210 | const closer = close; |
| 211 | close = null; |
| 212 | closer?.(); |
| 213 | attempts += 1; |
| 214 | if (attempts >= MAX_ATTEMPTS) { |
| 215 | // Out of attempts. Nothing on a timer from here — the tab coming back |
| 216 | // to the foreground is the only thing that tries again. |
| 217 | stopped = true; |
| 218 | return; |
| 219 | } |
| 220 | const delay = BACKOFF_MS[Math.min(attempts - 1, BACKOFF_MS.length - 1)] ?? 30_000; |
| 221 | retry = setTimeout(open, delay); |
| 222 | }, |
| 223 | }); |
| 224 | } |
| 225 |
nothing calls this directly
no outgoing calls
no test coverage detected