Skip to content

fix: poll race, live poll interval, stuck-threshold fix, SSO hint profile - #69

Merged
Skeyelab merged 4 commits into
mainfrom
fix/followups-63-66
Sep 29, 2026
Merged

Skeyelab merged 4 commits into
mainfrom
fix/followups-63-66

Conversation

@Skeyelab

Copy link
Copy Markdown
Member

Closes #63, closes #64, closes #65, closes #66. One commit per issue.

Fixes

  • SSO login hint passes the Account name as the --profile #66: the SSO login hint named the Account, not the profile.
    • The hint suggested aws sso login --profile libnd, but the profile is libnd-view. The pipeline section dropped the profile entirely.
    • Every section now passes ProjectState.Profile. A project with no Account gets plain aws sso login.
  • Stalled-stack fix uses a hard-coded 30-minute threshold #65: the stalled-stack fix used a hard-coded 30 minutes.
    • fix.Plan(proj, stalledAfter) now takes the threshold.
    • The dashboard gets it from the new config.Settings.StuckThreshold() at start and on every config reload. The poller uses the same helper.
    • The f key now offers "cancel stalled update" when the stuck alert fires.
  • Overlapping polls can publish an older snapshot after a newer one #63: overlapping polls could publish an older snapshot after a newer one.
    • A mutex held for the whole poll cycle, pollMu, now serializes cycles.
    • It is separate from the state lock, so Snapshot() isn't blocked by in-flight fetches.
  • Changing poll_interval_seconds has no effect until restart #64: changing poll_interval_seconds needed a restart.
    • ReloadConfig now hands a changed interval to the running ticker, which calls ticker.Reset.
    • An unchanged interval isn't sent, so a run of edits can't keep postponing polls.

Tests (each written failing first)

  • TestLoginHintNamesTheProfile covers the pipeline, stacks and ECS sections, plus default credentials. The existing stacks test had asserted the buggy --profile libnd, so I updated it.
  • TestPlan_stalledStackUsesTheGivenThreshold and TestFixKeyUsesTheStuckThreshold cover the new threshold.
  • TestRefreshDoesNotRaceAnInFlightPoll holds a slow cycle open, runs a refresh, and checks that the refresh's result wins.
  • TestReloadConfigAppliesNewPollInterval covers the new interval taking effect.
  • TestReloadConfigKeepsTickerWhenIntervalUnchanged covers the guard. I checked that it fails when mutated to always reset the ticker.
  • go test -race ./... passes and golangci-lint reports 0 issues.

The hint passed the Account name as --profile, but Accounts and profiles
differ (libnd uses libnd-view), so the suggested command failed. The
pipeline section dropped the profile altogether.

Closes #66
fix.Plan used a hard-coded 30 minutes, so with stuck_threshold_minutes
set lower a stack alerted as stuck well before the f key offered to
cancel its update. Plan now takes the threshold; the dashboard gets it
from config at start and on every reload.

Closes #65
ForceRefresh and ReloadConfig started extra poll goroutines alongside the
ticker's. Whichever finished last won, so a slow older cycle could
overwrite a newer one. A cycle-long mutex, separate from the state lock
so Snapshot() isn't held up by fetches, now serializes them.

Closes #63
Start read the interval once, so a new poll_interval_seconds from the
manage screen was ignored until restart. ReloadConfig now hands a changed
interval to the running ticker. An unchanged one is not sent, so a run of
edits can't keep resetting the ticker and postpone polling.

Closes #64
@Skeyelab
Skeyelab merged commit f31be91 into main Sep 29, 2026
3 checks passed
@Skeyelab
Skeyelab deleted the fix/followups-63-66 branch September 29, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant