FIX: report initializer catalog outages as unavailable, not unregistered - #2469
FIX: report initializer catalog outages as unavailable, not unregistered#2469fei (feiiiiii5) wants to merge 4 commits into
Conversation
…red (microsoft#2442) When GET /api/initializers (the registered catalog) fails while /api/initializers/settings succeeds, configured rows previously rendered with 'Initializer is no longer registered.' — presenting a temporary metadata outage as a definitive configuration problem. resolveRegisteredInitializer now takes a catalogAvailable flag: when the catalog could not be loaded, rows get an 'UnverifiedInitializer' placeholder whose copy says the catalog is temporarily unavailable and that registration state cannot be confirmed. A row is only described as no longer registered when a successful catalog response actually lacks the name. Initializers tracks catalog availability across refreshes and threads it through BaselineInitializers / AdditionalInitializers. Signed-off-by: fei <204683769+feiiiiii5@users.noreply.github.com>
…ilable
When the catalog request fails, the row resolves to an UnverifiedInitializer
placeholder with no parameter schema, but Edit stayed enabled — saving from
that dialog replaced existing parameters (e.g. {"mode": "strict"}) with null.
Edit is now disabled until the catalog reloads, the card states why inline,
and Apply/Remove stay usable since they operate on stored parameters only.
Signed-off-by: fei <204683769+feiiiiii5@users.noreply.github.com>
| interface AdditionalInitializersProps { | ||
| items: AdditionalInitializerSetting[] | ||
| registeredInitializers: RegisteredInitializer[] | ||
| catalogAvailable?: boolean |
There was a problem hiding this comment.
I’m thinking we could replace catalogAvailable with a catalog status union such as:
type CatalogStatus = 'loading' | 'loaded' | 'error'We could then keep the catalog entries separately and have the lookup return RegisteredInitializer | undefined instead of constructing synthetic RegisteredInitializer objects:
const initializer = registeredInitializers.find(
(item) => item.initializer_name === initializerName,
)The renderers could handle each state explicitly: error shows the unavailable message without rendering catalog-derived metadata, loaded with no match shows “no longer registered,” and loaded with a match renders the real metadata. Browse, Add, and Edit could require loaded, while Apply and Remove remain available.
This would avoid interpreting placeholder empty arrays as “Required env vars: None” or “No declared parameters,” and would also prevent cached catalog data from enabling controls after a failed refresh. Could we also cover initial failure, recovery, and loaded-then-failed-refresh transitions?
|
Agreed on all points — the status union is strictly better than the boolean. Plan: introduce |
|
Closing in favor of #2464, which covers the same fix for #2442 and carries the full review history. My apologies for the duplicate — it was unintentional. hannahwestra25 your status-union suggestion is implemented there in 20a5d7c: |
Purpose
Fixes #2442.
When
/api/initializers/settingssucceeds but the registered-Initializer catalog request transiently fails, the Initializers page kept the configured rows but described valid entries asInitializer is no longer registered.— presenting a temporary metadata availability failure as a definitive registration/configuration problem.What changed
resolveRegisteredInitializergains acatalogAvailableflag (defaulttrue, so existing call sites are unaffected). When the catalog could not be loaded, rows get anUnverifiedInitializerplaceholder whose copy says the catalog is temporarily unavailable and that registration state cannot be confirmed. The "no longer registered" claim is now only made when a successful catalog response actually lacks the name.Initializers.tsxtracks catalog availability across loads and refreshes and threads it throughBaselineInitializers/AdditionalInitializers.Validation
initializerLookup.test.ts): catalog-unavailable copy never contains "no longer registered"; available-catalog unknown names still produce the unregistered placeholder.Initializers.test.tsx): with settings succeeding and the catalog returning 5xx, the baseline row shows "temporarily unavailable" copy, does not show "no longer registered", and a Refresh after the catalog recovers restores the real description ("Registers targets.").tsc --noEmitclean; ESLint clean on all touched files.AI usage disclosure