chore(debug): TEMP map Ford catCode->vehicle-select->groups flow (revert after)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-05 15:21:35 +03:00
parent 27c7a81573
commit ce297893ee

View File

@@ -1789,6 +1789,30 @@ export class PL24FordLegacyService {
`Ford: ${groups.length} groups for ${serviceName}/${familyId} catCode=${catCode ?? "none"} arch=${arch}`,
);
// TEMP DEBUG: map the Ford catCode→vehicle-select→groups flow
if (groups.length === 0 && arch === "LEGACY_FORD") {
const vrows: Array<{ url: string; cap?: string }> = [];
for (const seg of html.split(/<tr\s/)) {
if (!seg.includes("tc-data-row")) continue;
const m = seg.match(/\burl="([^"]+)"/);
if (m?.[1].includes("vehicle.action")) {
vrows.push({ url: m[1], cap: seg.match(/\bcaption="([^"]+)"/)?.[1]?.slice(0, 40) });
}
}
this.logger.warn(
`Ford VSEL ${familyId} cc=${catCode}: ${vrows.length} vehicle rows; first3=${JSON.stringify(vrows.slice(0, 3))}`,
);
if (vrows.length) {
const vhtml = await this.fetchP4Page(vrows[0].url, serviceName, false);
const vtc = vhtml ? (vhtml.match(/tc-data-row/g) || []).length : 0;
const vgroups = vhtml ? this.parseFordGroupsFromHtml(vhtml, serviceName, familyId) : [];
const vtitle = vhtml?.match(/<title>([^<]*)<\/title>/i)?.[1];
this.logger.warn(
`Ford VSEL child: len=${vhtml?.length} title="${vtitle}" tcRows=${vtc} parsedGroups=${vgroups.length} names=${JSON.stringify(vgroups.slice(0, 6).map((g) => g.nameTr))}`,
);
}
}
if (groups.length > 0) {
await this.redis.setJson(cacheKey, groups, 7200);
}