Commit 86489e5
fix(headphones): recover from stalled check with Try Again + two-strike fail (#1241)
* fix(headphones): recover from stalled check instead of looping
If the user picks "I did not hear anything" the troubleshooting panel
now includes a Try Again button that resets the radio selection so
they can replay. A second "none" fails the check with
"Could not hear test sound." so the equipment flow restarts rather
than stalling indefinitely (seen on Firefox where the audio `playing`
event sometimes doesn't fire).
Also drop the `soundPlayed &&` gate on the pass branch — Firefox
occasionally misses the `playing` event, which was blocking legitimate
passes. Add `[HeadphonesCheck]` console logs on play/end/pause and a
`noneSelectedCount` field in the setupSteps debug payload for future
diagnosis.
Covered by HC-005 (retry button appears, no fail on first "none") and
new HC-005b (second "none" fails with error message).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* address Copilot review: fix off-by-one, reset counter, poll in tests
Component:
- Increment noneSelectedCountRef *before* logging so the setupSteps
debug payload matches the strike number that caused it (first "none"
logs 1, second logs 2 and fails). Previously the log was off by one.
- Reset the counter inside resetProgress() so that switching output
device via "Choose a different device" starts a fresh two-strike
window (prevents the next "none" from being mistakenly counted as
strike #2).
- Troubleshooting heading: h2 → h3 to preserve heading hierarchy
under the existing step h2, and fix "Lets" → "Let's".
Tests:
- HC-005 / HC-005b: replace synchronous asserts on the statuses/errors
arrays with expect.poll. setHeadphonesStatus fires from a useEffect
(async to the radio click), so the prior asserts could race.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3e857de commit 86489e5
2 files changed
Lines changed: 83 additions & 12 deletions
File tree
- client/src/intro-exit/setup
- playwright/component-tests/equipment-check
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
54 | | - | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
59 | | - | |
60 | | - | |
| 63 | + | |
| 64 | + | |
61 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
62 | 71 | | |
63 | 72 | | |
64 | | - | |
| 73 | + | |
65 | 74 | | |
66 | 75 | | |
67 | 76 | | |
| |||
102 | 111 | | |
103 | 112 | | |
104 | 113 | | |
| 114 | + | |
| 115 | + | |
105 | 116 | | |
106 | 117 | | |
107 | 118 | | |
| |||
139 | 150 | | |
140 | 151 | | |
141 | 152 | | |
| 153 | + | |
142 | 154 | | |
143 | 155 | | |
144 | 156 | | |
| |||
148 | 160 | | |
149 | 161 | | |
150 | 162 | | |
151 | | - | |
152 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
153 | 171 | | |
154 | 172 | | |
155 | 173 | | |
| |||
275 | 293 | | |
276 | 294 | | |
277 | 295 | | |
278 | | - | |
279 | | - | |
| 296 | + | |
| 297 | + | |
280 | 298 | | |
281 | 299 | | |
282 | 300 | | |
283 | 301 | | |
284 | 302 | | |
285 | 303 | | |
286 | 304 | | |
287 | | - | |
288 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
289 | 317 | | |
290 | 318 | | |
291 | 319 | | |
| |||
Lines changed: 45 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
227 | 228 | | |
228 | 229 | | |
229 | | - | |
| 230 | + | |
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
| |||
236 | 237 | | |
237 | 238 | | |
238 | 239 | | |
| 240 | + | |
239 | 241 | | |
240 | 242 | | |
241 | 243 | | |
242 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
243 | 286 | | |
244 | 287 | | |
245 | 288 | | |
| |||
0 commit comments