Skip to content

fix(console): close two pending-state gaps - #212

Merged
dmf-cms-automerge[bot] merged 1 commit into
mainfrom
fix/863-pending-state-gaps
Nov 7, 2026
Merged

dmf-cms-automerge[bot] merged 1 commit into
mainfrom
fix/863-pending-state-gaps

Conversation

@znerol2

@znerol2 znerol2 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Summary

The adversarial review of #861 found two pending-state gaps. They already existed on main.

  • Malformed topology entries. The three useInstanceTopology consumers (ConfigureStage, DesignStage, WorkloadHome) checked only that sources was an array. A null entry threw during render, and an entry without an id was shown or offered as a source. A new shared hasValidSources (frontend/src/lib/topologySources.ts) rejects any entry that isn't an object with a string id. The payload is then treated as malformed, which fails closed exactly as a non-array does. The #861 pending snapshot still keeps the switch panel while a switch is in flight.
  • Stale-inventory guidance while pending. ReasonConfirm told the operator "Confirm again after the next successful read" when inventory went stale after the request had already been sent. That guidance is now hidden while pending, and returns unchanged once the request settles. Every caller gets this.

Tests

  • switchSourcePending.test.tsx is extended with sources: [null] and [{}] cases, both with nothing pending and with a switch pending. The new reasonConfirmPendingStale.test.tsx covers stale inventory during and after a pending request.
  • On an export of main with these tests: 3 failed | 10 passed (13). Two of the new cases also pass on main and guard against regressions. On this branch: all pass.
  • Full unit suite: 1138 passed. Lint, build and typecheck pass. Playwright e2e: 298 passed, 88 skipped by the suite's own conditions.

Review

One round of adversarial review. Its only finding was a comment that overstated when an id-less entry throws, and it is corrected.

Closes dmfdeploy/dmfdeploy#863

A topology poll whose sources held a null entry crashed the views that
read it, and an entry without an id was shown or offered as a source.
Validate every entry with one shared check and treat anything else as
malformed, which fails closed as before; the pending switch snapshot
still holds.

ReasonConfirm also told the operator to confirm again when inventory
went stale while a request was already in flight. Hide that guidance
while pending; it returns once the request settles.

Closes dmfdeploy/dmfdeploy#863

Signed-off-by: znerol2 <6800371+znerol2@users.noreply.github.com>
@znerol2
znerol2 requested a review from a team as a code owner November 7, 2026 13:54
@dmf-cms-automerge
dmf-cms-automerge Bot enabled auto-merge (rebase) November 7, 2026 14:00

@lkirc lkirc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed current head ad53b88. No blocking findings.

Malformed source entries now fail closed across all topology consumers, and pending-state guidance is covered. Required checks are green.

@dmf-cms-automerge
dmf-cms-automerge Bot merged commit 89a226a into main Nov 7, 2026
18 checks passed
@dmf-cms-automerge
dmf-cms-automerge Bot deleted the fix/863-pending-state-gaps branch November 7, 2026 14:10
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.

Console: two pending-state gaps in the confirm panel and the switch control

2 participants