Fix FluentSelect/FluentCombobox value binding when options change#16315
Merged
Fix FluentSelect/FluentCombobox value binding when options change#16315
Conversation
- Add ChoiceVersion counter to InputViewModel, incremented only when options actually differ, used as @key on FluentSelect and FluentCombobox to force component recreation and avoid the web component clearing the bound value during an options refresh. - Cache Azure API calls in RunModeProvisioningContextProvider dynamic loading callbacks using ConcurrentDictionary to avoid redundant fetches. - Add Azure provisioning simulation command to Stress playground.
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16315Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16315" |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes flaky value binding for choice inputs in the Dashboard interaction dialog when options/value change simultaneously, and reduces repeated Azure ARM lookups during run-mode provisioning prompts. Adds a stress-playground command to manually exercise cascading dynamic inputs.
Changes:
- Add
InputViewModel.ChoiceVersionand use it to force re-creation of choice components when options change. - Cache ARM-backed dynamic-loading callbacks in
RunModeProvisioningContextProviderto avoid redundant API calls. - Add a stress playground command that simulates the Azure provisioning cascading input flow.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Dashboard.Components.Tests/Model/InputViewModelTests.cs | Adds unit tests covering ChoiceVersion increment behavior. |
| src/Aspire.Hosting.Azure/Provisioning/Internal/RunModeProvisioningContextProvider.cs | Adds per-tenant/subscription caches for dynamic-loading callbacks. |
| src/Aspire.Dashboard/Model/Interaction/InputViewModel.cs | Introduces ChoiceVersion and option equality logic to control re-creation. |
| src/Aspire.Dashboard/Components/Dialogs/InteractionsInputDialog.razor.cs | Minor whitespace cleanup. |
| src/Aspire.Dashboard/Components/Dialogs/InteractionsInputDialog.razor | Adds @key to choice components to recreate on option changes. |
| playground/Stress/Stress.AppHost/InteractionCommands.cs | Adds “azure-provisioning-simulation” command and reformats existing code. |
Contributor
|
🎬 CLI E2E Test Recordings — 72 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #24644281093 |
mitchdenny
approved these changes
Apr 20, 2026
This was referenced Apr 24, 2026
Closed
Closed
Closed
Closed
Closed
Closed
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
Fix an issue where
FluentSelectandFluentComboboxinputs inInteractionsInputDialogsometimes lose their bound value when the list of options and value change at the same time. The underlying web component can emit an internal change event during an options rebuild, clearing the bound value before the new one takes effect.Changes:
InputViewModel.ChoiceVersion— Added a counter that increments only whenSelectOptionsactually change. Used as a@keyonFluentSelectandFluentComboboxin the dialog so Blazor destroys and recreates the component when options change, initializing it fresh with the correct options and value together. Skips increment when the new options match the existing ones.Azure provisioning API call caching —
RunModeProvisioningContextProviderdynamic loading callbacks now cache results usingConcurrentDictionary<string, Task<T>>(keyed by tenant/subscription ID) to avoid redundant Azure API calls. The biggest win is the Location callback, which previously re-fetched resource groups and locations on every resource group change.Stress playground — Added an "Azure provisioning simulation" command to the Stress AppHost that exercises the full cascading dynamic inputs pattern (Tenant → Subscription → ResourceGroup → Location) with pretend data, for manual testing of the interaction dialog.
Fixes https://youtu.be/0s64lPsr6oM?t=13143
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: