Repository navigation
FIX: Guard preset save races - #3819
Open
Roman Lutz (romanlutz) wants to merge 1 commit into
Open
Roman Lutz (romanlutz) wants to merge 1 commit into
Roman Lutz (romanlutz) wants to merge 1 commit into
Conversation
Keep the selected scenario separate from resolved metadata and reject superseded requests, including programmatic submits before selection state commits. Preserve failed selections, loaded preset values, and already accepted saves. Fixes microsoft#3755 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the change addressing stale-scenario saves in the preset editor.
No open issues 🎉
What changed in this PR
Addresses #3755 by preventing the preset editor from saving the previous scenario’s configuration while a new selection loads.
Changes:
- Tracks the selected scenario separately from loaded metadata, guards submissions, and ignores stale responses.
- Adds regression coverage for selection races, failures and retries, unmounting, accepted saves, and stored list preservation.
- Documents Save availability and failed-load behavior without changing shared serialization or launch behavior.
| File | Description |
|---|---|
frontend/src/components/ScenarioPresets/ScenarioPresetEditor.tsx |
Adds selection tracking, request guards, and Save readiness checks. |
frontend/src/components/ScenarioPresets/ScenarioPresetEditor.test.tsx |
Covers race conditions and preservation of existing save behavior. |
doc/gui/0_gui.md |
Explains loading and failure behavior in the preset editor. |
Review effort: Balanced
This branch has not been deployed
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.
Description
Switching scenarios in the preset editor could leave the previous scenario and configuration available to Save while the new metadata was loading.
Fixes #3755
Track the selected scenario separately from its resolved metadata. Disable and guard Save until the selected configuration is ready, including programmatic submits fired before React commits the selection change. Ignore outdated metadata responses after another selection or unmount. Failed loads retain the selection and show the existing error UI; already accepted saves are left alone.
This is limited to the selection/save race. Shared preset/form serialization, loaded-list values, and launch behavior are unchanged.
Tests and Documentation
Added focused regressions for pending replacements, direct and same-event submissions, reversed responses, failure/retry, navigation/unmount, accepted saves, and edit-mode list preservation. Updated the GUI documentation to explain loading and failure behavior.
Validation completed on the delivered commit before opening this PR. Commands below ran from
frontend.Passed: 4 suites, 287 tests. Includes the existing ScenarioDetail and shared preset/form parameter coverage.
npm run type-checknpm exec -- tsc --noEmit --project tsconfig.test.jsonnpm exec -- eslint src\components\ScenarioPresets\ScenarioPresetEditor.tsx src\components\ScenarioPresets\ScenarioPresetEditor.test.tsx --report-unused-disable-directives --max-warnings 0npm run buildPassed: 5 existing offline browser tests. A separate offline Chromium check against the built editor also passed at 1440x1000 and 390x844, covering keyboard selection, pending submissions, reversed responses, error retention, and retry. These were fixture-backed browser observations, not live backend saves. All verification helpers are stopped.
JupyText: Not run; the change is frontend-only with a Markdown documentation update.