chore(debug): TEMP Ford session-state test (vehicle.action then bare group.action)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-05 15:30:00 +03:00
parent 26efef22d4
commit cd5c2e5c43

View File

@@ -1835,6 +1835,27 @@ export class PL24FordLegacyService {
this.logger.warn(`Ford CHAIN L${lvl}: following "${next.cap}" → ${next.url.slice(0, 70)}`);
curHtml = await this.fetchP4Page(next.url, serviceName, false);
}
// Session-state test: after a vehicle.action select, does a bare group.action
// (reading server-side selection) return groups?
const cfg2 = getServiceConfig(serviceName);
const bp = cfg2 ? `${cfg2.basePath}/${serviceName}` : `/ford/${serviceName}`;
await this.fetchP4Page(
`vehicle.action?lang=tr&modelFamily=${encodeURIComponent(famBase)}&startup=false&mode=${mode}&upds=${upds}`,
serviceName,
false,
);
const bareUrl = `${this.baseUrl}${bp}/group.action?lang=tr&startup=false&mode=${mode}&upds=${upds}`;
const bareHtml = await this.fetchP4Page(bareUrl, serviceName, true);
const bareGroups = bareHtml ? this.parseFordGroupsFromHtml(bareHtml, serviceName, familyId) : [];
const bareKinds = bareHtml
? (bareHtml.match(/(vehicle|group)\.action/g) || []).reduce<Record<string, number>>((a, k) => {
a[k] = (a[k] || 0) + 1;
return a;
}, {})
: {};
this.logger.warn(
`Ford SESSION-TEST: bare group.action after select → title="${bareHtml?.match(/<title>([^<]*)<\/title>/i)?.[1]}" parsedGroups=${bareGroups.length} actionKinds=${JSON.stringify(bareKinds)}`,
);
}
if (groups.length > 0) {