Repository navigation
Leave out a Volvo's energy-state when it answers a plain 404 - #434
Conversation
A Volvo without the Energy API (a combustion or mild-hybrid car) answers energy-state with a plain 404. It was recorded as the vehicle's failure at every poll, newer than its latest read, and a call spent each time. It now takes the optional endpoints' path: left out for a details interval, logged once, no failure. The market's refusal, a 404 there too but KindMarket, still marks the market. The charging state comes from energy-state alone: once it is missing, none is known, so that a vehicle seen charging does not stay in the charging mode. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Medium Merge Risk:
|
A Volvo without the Energy API (a combustion or mild-hybrid car) answers
energy-statewith a plain 404. The collector recorded it as the vehicle's failure (not_found) at every poll, newer than itsread_at, and spent a call each time.energy-state's plain 404 (KindNotFound,energyMissing) now takes the optional endpoints' path infetchFailed: left out for a details interval, logged once, no failure told.KindMarket(does not belong to allowed markets), keeps its own path and still setsmarket_refused_at.energy-statealone: once it is missing, it is cleared, so that a vehicle seen charging does not stay in the charging mode, polled every minute.AGENTS.md: the optional endpoints' line says so.A
not_foundfailure already stored stays until another failure replaces it (a zero failure keeps the stored one, as before).Closes #433
How it was tested
TestFailures: a vehicle whoseenergy-stateanswers a plain 404 over 25 hours is called twice for it, has no failure, no market marked, one log line; a vehicle seen charging whoseenergy-statethen answers 404 goes back to parked, its charging state unknown. Both fail without the change (mutation checked); the existing market-refused cases pass unchanged.task unit-go(fmt-check, lint, tests without PostgreSQL, govulncheck, build).task unitpasses (unit-go; the front end is untouched)The API's diff (
api/openapi.yaml,internal/api/testdata/) is intended, or there is noneTexts in English, French, German, Italian, Dutch, Norwegian, Spanish and Swedish, if the interface changed
No real VIN, token, API key or position, fixtures included
🤖 Generated with Claude Code
Summary by CodeRabbit