Fix UpdateProvidersAsync overwriting embedder/vector store providers on partial updates #21796
BackSummary
- Fix
UpdateProvidersAsyncoverwritingSupportedEmbedderProvidersandSupportedVectorStoreProviderswith empty arrays when called with only chat provider parameters (null for embedder/vector store) - This was triggered by the ABP Suite template's temporary workaround in
WebModule.OnPostApplicationInitializationAsyncwhich calledUpdateProvidersAsyncwith onlyChatClientFactoryOptions, wiping out the correctly-saved values fromInitialWorkspaceUpdater - Add
autoSave: trueto both insert and update paths for reliable persistence - Closes #21788
Root Cause
In layered apps, the generated WebModule contained a temporary fix that called UpdateProvidersAsync(appName, chatProviders) after InitialWorkspaceUpdater had already correctly saved all three provider types. Since the optional supportedEmbedderProviders and supportedVectorStoreProviders parameters defaulted to null, the update path treated them as empty arrays and overwrote the existing values.
Test plan
- Verified with
AbpSolution875771095layered app using local source references - Database query confirmed all three columns populated:
SupportedProviders=OpenAI,Ollama,SupportedEmbedderProviders=OpenAI,SupportedVectorStoreProviders=Pgvector