fix(vinpin): warm Fiat window-fault falls back to cold (not throw→null)
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled

The last gap: when ensureWarmWindow('fiat') can't bring the Fiat ePER to its VIN
panel (partial Rpartstore-down session leaves it off-panel + re-nav can't recover),
warmDecode threw SessionDropped → re-warm → null, turning a DECODABLE Fiat VIN into
a not_found. Fall back to the proven cold Fiat path instead, so a warm-window fault
never loses a real decode. Completes the FIX2 cold-fallback (previously only the
unusable-parse branch had it; now the can't-reach-panel branch does too).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-15 13:56:40 +03:00
parent dac0708cda
commit d7d78a77a6

View File

@@ -638,7 +638,17 @@ export class VinpinDriverService implements OnModuleDestroy {
}
if (win === "fiat") {
if (!(await this.ensureWarmWindow(page, "fiat", cfg))) {
throw new VinpinSessionDroppedError("could not focus the Fiat ePER window");
// The warm Fiat window can't be brought to its VIN panel (e.g. a partial
// Rpartstore-down session left it off-panel and the re-nav couldn't recover
// it). Don't throw → re-warm → null (which loses a DECODABLE VIN). Fall back
// to the proven cold Fiat path (fresh establish + its own retries), so a
// warm-window fault never turns a real decode into a not_found.
this.logger.warn(
`warm ${vin}: could not reach the Fiat ePER VIN panel — cold Fiat fallback`,
);
this.warm = false;
await this.close();
return this.decodeFiatLocked(vin, cfg, deadline);
}
const text = await this.runVinFlow(page, vin);
// Dismiss the modal so the field is ready for the NEXT VIN in this session.