Commit f03ef72
fix(programs): manual Refresh now actually re-fetches from H1/BC/IT (+ 429 retry)
Two bugs around the user expectation "click Refresh, get fresh scope":
1) The top-right ↻ Refresh button on the Programs page called loadPrograms() (no
force=true), which only re-read the cached payload from disk. Result: clicking
Refresh did NOT trigger a backend warmer rebuild, so stale scope (e.g. Ryan-BBP
added new assets today but AutoAR's view didn't reflect it) stayed stale. Wire
refreshCurrentView() for the Programs view through ProgramsPage.refreshNow(),
which triggers /api/scope/programs?refresh=true → forces the warmer rebuild.
2) Even with that fix, the warmer was bailing out on rate-limited programs.
fetchH1ScopeSummary now retries up to 3 times with exponential backoff on 429
(2s, then 4s), and honors a sensible Retry-After header (≤30s) when H1
provides one. So the warmer doesn't routinely leave hundreds of programs with
stale empty scope when the H1 token is being hammered.
Net effect: clicking Refresh on the Programs page kicks off a real rebuild, and
the rebuild is far more likely to actually capture the current scope for every
program — which means the scope-update watch sees Ryan's new asset on the next
refresh and fires the Discord alert.
Verified: go build/vet/node --check clean.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 6f094b6 commit f03ef72
2 files changed
Lines changed: 43 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
507 | 510 | | |
508 | 511 | | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | 512 | | |
517 | | - | |
518 | | - | |
519 | | - | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
520 | 546 | | |
521 | | - | |
522 | | - | |
523 | 547 | | |
524 | | - | |
525 | | - | |
526 | | - | |
| 548 | + | |
527 | 549 | | |
528 | 550 | | |
529 | 551 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
| |||
0 commit comments