fix(pl24): Ford VIN flow + cleanup user-vehicle leaf bugs (cherry-pick to main) #14

Merged
root merged 4 commits from fix-pl24-vin-prod into main 2026-05-16 10:04:53 +03:00
Owner

Cherry-picks 4 commits from dev to fix Ford P4 (fordp_parts) VIN-decoded vehicles which currently land on an empty / broken category page in prod.

Cherry-picked commits

  • 0322177 fix(pl24): drop P4 nav-crumb links from decoded categories
  • be3fb2a feat(pl24): wire Ford/Volvo VIN-decode flow end-to-end via json-vin endpoints
  • 2bf5e16 fix(pl24): pass Ford VIN BOM detail URL through fetchP4Page baseUrl prefix
  • af41420 fix(categories): treat image-board.action linkPaths as leaves in user-vehicle flow

Why

PL24's Ford/Volvo P4 legacy catalog only ships header breadcrumb links on the VIN-group HTML page; the real catalog hangs off json-vin-main-group.action, json-vin-sub-group.action, vin-image-board.action, and json-vin-bom-detail.action. The decoder was scraping the wrong page and persisting nav crumbs (Portal / Model seçimi / VIN) as if they were part categories, leaving users with three useless rows. The new chain wires all three endpoints + the BOM detail expander, so a user who decoded a Ford VIN now sees real Turkish part categories with OEM codes drillable end-to-end.

Test plan

  • Verified on dev with VIN WF0FXXGBBFVD48212 (Ford Mondeo): 8 maingroups, 58 subgroups per group, 30 parts in 'Ön Tamponlar' leaf with real OEMs (YS71-17757-AB, 96BB-17K876-AL, etc.), schema PNG, 43 hotspots
  • Variant entries (Sağ/Sol) kept as separate parts with remark column
  • After merge: clear redis vehicle cache for existing prod Ford VINs and seed maingroups (cleanup script ready)

🤖 Generated with Claude Code

Cherry-picks 4 commits from dev to fix Ford P4 (fordp_parts) VIN-decoded vehicles which currently land on an empty / broken category page in prod. ## Cherry-picked commits - `0322177` fix(pl24): drop P4 nav-crumb links from decoded categories - `be3fb2a` feat(pl24): wire Ford/Volvo VIN-decode flow end-to-end via json-vin endpoints - `2bf5e16` fix(pl24): pass Ford VIN BOM detail URL through fetchP4Page baseUrl prefix - `af41420` fix(categories): treat image-board.action linkPaths as leaves in user-vehicle flow ## Why PL24's Ford/Volvo P4 legacy catalog only ships header breadcrumb links on the VIN-group HTML page; the real catalog hangs off `json-vin-main-group.action`, `json-vin-sub-group.action`, `vin-image-board.action`, and `json-vin-bom-detail.action`. The decoder was scraping the wrong page and persisting nav crumbs (Portal / Model seçimi / VIN) as if they were part categories, leaving users with three useless rows. The new chain wires all three endpoints + the BOM detail expander, so a user who decoded a Ford VIN now sees real Turkish part categories with OEM codes drillable end-to-end. ## Test plan - [x] Verified on dev with VIN WF0FXXGBBFVD48212 (Ford Mondeo): 8 maingroups, 58 subgroups per group, 30 parts in 'Ön Tamponlar' leaf with real OEMs (YS71-17757-AB, 96BB-17K876-AL, etc.), schema PNG, 43 hotspots - [x] Variant entries (Sağ/Sol) kept as separate parts with remark column - [ ] After merge: clear redis vehicle cache for existing prod Ford VINs and seed maingroups (cleanup script ready) 🤖 Generated with Claude Code
root added 4 commits 2026-05-16 10:04:46 +03:00
VIN-group HTML for Ford/Volvo legacy services exposes the header
breadcrumb links (Portal / Model seçimi / current VIN) via the same
.action pattern the parser relied on, so they were being persisted as
"part categories" — users saw three useless rows instead of real groups.
The PSA flow already documented this trap and bypassed rawData; extend
the same defense to the rest of P4 legacy (parser-side + categories
insert fallback).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
VIN-decoded Ford P/T and Volvo legacy vehicles used to land on an empty
category page: the .action HTML the decoder scraped only carried header
breadcrumbs (Portal / Model seçimi / VIN). The real catalog hangs off
three JSON endpoints that the partslink24 UI calls in the background
once a VIN session is established. None of them need mode/upds/JSESSIONID
beyond the standard PL24TOKEN cookie. Plumb the whole chain so a user
who decoded a VIN sees real Turkish part categories and OEM part
numbers in the user-vehicle flow:

  json-vin-main-group.action   → real top-level groups (8 for Mondeo)
  json-vin-sub-group.action    → 58 leaf subgroups (filters subheaders)
  vin-image-board.action       → BOM table with pncHierCode + jsonUrl
  json-vin-bom-detail.action   → final OEM partno entries (per variant)

Schema image fetch reuses the existing image-ticket extractor since the
ticket URL lives in the same jsIlluData payload as Hyundai/Opel/Volvo.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fetchFordVinBomParts was forwarding the relative HTML jsonUrl with
isFullUrl=true, which made undici try to parse \`/ford/fordp_parts/…\`
as an absolute URL and throw "Failed to parse URL" for every PNC row.
The Hyundai BOM expander next door calls fetchP4Page with the default
isFullUrl=false (relative path) — match that.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fix(categories): treat image-board.action linkPaths as leaves in user-vehicle flow
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled
af4142077f
getChildren had a leaf-detection whitelist that covered BOM/partinfo paths
but missed PL24's image-board.action (and the VIN variant). When users
clicked into a vin-image-board.action leaf, fetchSubGroupsByPath ran on
its HTML, parsed the BOM rows' jsonUrl="...json-vin-bom-detail.action..."
attributes as if they were sub-groups, and inserted 10+ ghost category
rows under the leaf — each pointing to a per-part endpoint that's not
a sub-group at all. Drilling into one of those ghosts then surfaced the
"0 parça listeleniyor" empty state instead of the real BOM table.

Add both image-board.action and json-vin-bom-detail.action to the leaf
detection list so the flow short-circuits and getCategoryWithParts
handles them via fetchPartsByPath as designed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
root merged commit 4a72f2482b into main 2026-05-16 10:04:53 +03:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: root/sase.tr#14