Fix compatibility message overriding more-severe probe error message
Only use the compatibility advisory's message when the advisory actually changed the provider status. Previously, a warning-severity advisory message would unconditionally override a more important error message from the probe, even though the status correctly remained 'error'. This created a contradictory UX where the status showed an error but the message downplayed the issue. The fix moves the status computation before the message computation and gates compatibilityMessage on status !== snapshot.status, so the advisory message is only used when the advisory drove the status change.
This commit is contained in:
1 file changed
+4
-4
@@ -293,10 +293,6 @@ function applyCompatibilityAdvisory<Snapshot extends ProviderCompatibilitySnapsh
|
||||
return snapshotWithoutAdvisory as Snapshot;
|
||||
}
|
||||
|
||||
const compatibilityMessage =
|
||||
compatibilityAdvisory.severity !== "info"
|
||||
? (compatibilityAdvisory.message ?? undefined)
|
||||
: undefined;
|
||||
const status =
|
||||
snapshot.enabled && compatibilityAdvisory.severity === "error"
|
||||
? "error"
|
||||
@@ -305,6 +301,10 @@ function applyCompatibilityAdvisory<Snapshot extends ProviderCompatibilitySnapsh
|
||||
snapshot.status === "ready"
|
||||
? "warning"
|
||||
: snapshot.status;
|
||||
const compatibilityMessage =
|
||||
status !== snapshot.status && compatibilityAdvisory.severity !== "info"
|
||||
? (compatibilityAdvisory.message ?? undefined)
|
||||
: undefined;
|
||||
|
||||
return {
|
||||
...snapshot,
|
||||
|
||||
Reference in new issue
Block a user