Skip to content

Commit 0883def

Browse files
committed
fix: fall back to bundled policy when remote document has no matching policy
When a remote compatibility document was fetched successfully but had no policy matching the current driver/T3 Code version, the enrichment path treated that as 'no advisory' and stripped any existing bundled advisory, restoring the provider to ready status even if the bundled map marked it as broken. Now createProviderCompatibilityAdvisory tries the provided (remote) document first, and if it yields no matching policy, falls through to the bundled document. This matches the documented intent that the bundled file is the fallback when the remote map has no applicable policy.
1 parent e035af7 commit 0883def

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

apps/server/src/provider/ProviderCompatibility.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,26 @@ export function createProviderCompatibilityAdvisory(input: {
204204
readonly maintenanceCapabilities?: ProviderMaintenanceCapabilities | undefined;
205205
readonly t3CodeVersion?: string;
206206
}): ServerProviderCompatibilityAdvisory | undefined {
207-
return createProviderCompatibilityAdvisoryFromDocument({
208-
document: input.document ?? bundledProviderCompatibilityDocument,
207+
const shared = {
209208
driver: input.driver,
210209
currentVersion: input.currentVersion,
211210
maintenanceCapabilities: input.maintenanceCapabilities,
212211
...(input.t3CodeVersion ? { t3CodeVersion: input.t3CodeVersion } : {}),
212+
};
213+
214+
if (input.document) {
215+
const advisory = createProviderCompatibilityAdvisoryFromDocument({
216+
document: input.document,
217+
...shared,
218+
});
219+
if (advisory) {
220+
return advisory;
221+
}
222+
}
223+
224+
return createProviderCompatibilityAdvisoryFromDocument({
225+
document: bundledProviderCompatibilityDocument,
226+
...shared,
213227
});
214228
}
215229

0 commit comments

Comments
 (0)