Commit 57763eb
committed
fix(miner-ui): stop a stale governor poll from reverting a just-applied pause/resume
LedgersPage syncs the governor pause-state from two independent sources with no
ordering guard: a usePolledFetch GET synced during render, and the operator's
pause/resume POST written directly on resolve. The POST doesn't share the poll's
single-flight guard, so a poll GET already in flight when the operator clicks can
resolve after the action's POST and clobber the fresh result with a stale
pre-action value -- the UI reverts to "Not paused" (or "paused") until the next
tick self-corrects. Mark the next poll-sync after an action lands as to-skip (that
poll may predate the action, so its result is not newer); later ticks sync
normally, mirroring the generation/cancellation discipline usePolledFetch and
useStreamingText already use. The flag is state, not a ref, so the render-phase
sync reads it without accessing a ref during render.1 parent 80eb9f3 commit 57763eb
2 files changed
Lines changed: 60 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 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 | + | |
370 | 414 | | |
371 | 415 | | |
372 | 416 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
432 | 440 | | |
433 | 441 | | |
434 | 442 | | |
| |||
440 | 448 | | |
441 | 449 | | |
442 | 450 | | |
443 | | - | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
444 | 458 | | |
445 | 459 | | |
446 | 460 | | |
447 | 461 | | |
448 | 462 | | |
| 463 | + | |
449 | 464 | | |
450 | 465 | | |
451 | 466 | | |
| |||
0 commit comments