Repository navigation
fix(console): close two pending-state gaps - #212
Merged
Merged
Conversation
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>
Closed
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The adversarial review of #861 found two pending-state gaps. They already existed on main.
useInstanceTopologyconsumers (ConfigureStage, DesignStage, WorkloadHome) checked only thatsourceswas an array. Anullentry threw during render, and an entry without an id was shown or offered as a source. A new sharedhasValidSources(frontend/src/lib/topologySources.ts) rejects any entry that isn't an object with a stringid. 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.pending, and returns unchanged once the request settles. Every caller gets this.Tests
switchSourcePending.test.tsxis extended withsources: [null]and[{}]cases, both with nothing pending and with a switch pending. The newreasonConfirmPendingStale.test.tsxcovers stale inventory during and after a pending request.3 failed | 10 passed (13). Two of the new cases also pass on main and guard against regressions. On this branch: all pass.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