promote(decode): opaque candidate keys + slim decode response #122
Reference in New Issue
Block a user
Delete Branch "promote-decode"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Cherry-picks
2077a97+02c8321from dev (verified on dev.sase.tr): decode-source details stay server-side (Redis candidate stash, opaque keys), decode response slimmed to {id, brandName, model, year} — drops rawData (p95 ~127KB) and provider name from every decode.🤖 Generated with Claude Code
The multi-candidate decode response leaked provider internals (source name, pcat car ids, EMEX _ssd/_vid/_quickGroupsUrl/catalogId) and made the client carry them between requests: the frontend stored candidateSource and echoed pcatCarId/emexCarIndex back on selection. Now the candidate list returned to the client carries only display fields (name, description, parameters) plus an opaque key, and the provider mapping is stashed in Redis (vin:candidates:*, 30m TTL, resolve-cache fallback). The pick request sends just { vin, candidate }. Legacy pcatCarId/emexCarIndex body params still work for already-loaded bundles. Also drops `source` from the public /vehicles/preview response — no consumer used it, and provider names must never be public (same policy as teaser-stats). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> (cherry picked from commit2077a9724a)POST /vehicles/decode returned the full vehicles row while every consumer (search, landing, service-test) only navigates by id and re-fetches via GET /vehicles/:id. That shipped the raw upstream decode payload to the client on every decode — rawData is 19KB avg / 127KB p95 / 207KB max in prod — plus the provider name, for nothing. The response is now { id, brandName, model, year } on both the DB-hit and fresh-decode paths. Frontend drops the (now absent) source property from the vin_decode_success event; decode source remains queryable server-side via query_logs.source. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> (cherry picked from commit02c8321023)