Skip to content

fix(tui): bound the refresh cycle and stop overlapping polls - #3

Merged
PentSec merged 1 commit into
mainfrom
fix/refresh-hardening
Oct 29, 2026
Merged

PentSec merged 1 commit into
mainfrom
fix/refresh-hardening

Conversation

@PentSec

@PentSec PentSec commented Oct 29, 2026

Copy link
Copy Markdown
Owner

fix(tui): bound the refresh cycle and stop overlapping polls

The cause of the stuck loading state reported in #1 is unconfirmed. This
bounds the refresh cycle (credential lookup included) at 15s, prevents
overlapping polls, and reports unexpected throws, so any async stall or
throw ends in a visible terminal state.

  • race the whole fetchUsage() cycle against a REFRESH_TIMEOUT_MS deadline
    and render "request timed out" when the deadline wins
  • skip a poll while the previous cycle is still in flight, so a slow cycle
    cannot queue another one every 60s
  • report an unexpected throw as "unexpected error" without leaking
    internals, instead of leaving the row on the loading ellipsis
  • keep the disposed flag authoritative: no status write after unmount

Builds on the Show/keyed markup from #1 (saihgupr), which is unchanged
here.

The cause of the stuck loading state reported in #1 is unconfirmed. This
bounds the refresh cycle (credential lookup included) at 15s, prevents
overlapping polls, and reports unexpected throws, so any async stall or
throw ends in a visible terminal state.

- race the whole fetchUsage() cycle against a REFRESH_TIMEOUT_MS deadline
  and render "request timed out" when the deadline wins
- skip a poll while the previous cycle is still in flight, so a slow cycle
  cannot queue another one every 60s
- report an unexpected throw as "unexpected error" without leaking
  internals, instead of leaving the row on the loading ellipsis
- keep the disposed flag authoritative: no status write after unmount

Builds on the Show/keyed markup from #1 (saihgupr), which is unchanged
here.
@PentSec
PentSec merged commit bd4eeb5 into main Oct 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant