Skip to content

Commit 1412326

Browse files
committed
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.
1 parent 1408240 commit 1412326

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

apps/server/src/provider/providerCompatibility.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,6 @@ function applyCompatibilityAdvisory<Snapshot extends ProviderCompatibilitySnapsh
293293
return snapshotWithoutAdvisory as Snapshot;
294294
}
295295

296-
const compatibilityMessage =
297-
compatibilityAdvisory.severity !== "info"
298-
? (compatibilityAdvisory.message ?? undefined)
299-
: undefined;
300296
const status =
301297
snapshot.enabled && compatibilityAdvisory.severity === "error"
302298
? "error"
@@ -305,6 +301,10 @@ function applyCompatibilityAdvisory<Snapshot extends ProviderCompatibilitySnapsh
305301
snapshot.status === "ready"
306302
? "warning"
307303
: snapshot.status;
304+
const compatibilityMessage =
305+
status !== snapshot.status && compatibilityAdvisory.severity !== "info"
306+
? (compatibilityAdvisory.message ?? undefined)
307+
: undefined;
308308

309309
return {
310310
...snapshot,

0 commit comments

Comments
 (0)