Skip to content

fix: handle NULL car profile fields in /api/v1/cars - #511

Merged
tobiasehlert merged 1 commit into
mainfrom
not-support-2026-model-y-with-glacier-bl
Jul 7, 2026
Merged

fix: handle NULL car profile fields in /api/v1/cars#511
tobiasehlert merged 1 commit into
mainfrom
not-support-2026-model-y-with-glacier-bl

Conversation

@tobiasehlert

Copy link
Copy Markdown
Owner

This fixes a corner case on fresh TeslaMate setups where the car can still be offline/asleep and some profile fields in cars remain NULL. In that window, /api/v1/cars could fail while scanning nullable text columns into Go string fields.

This change makes the endpoint resilient by scanning exterior_color, spoiler_type, and wheel_type as NullString, matching the existing handling for trim_badging. That keeps the response working until TeslaMate has populated the full vehicle profile.

This is intentionally scoped to the cars endpoint. Other endpoints may have their own nullable-field handling and were not changed here.

Fixes: #477

Fixes a corner case on fresh TeslaMate setups where car profile fields may still be NULL before the vehicle has come online. Update the /api/v1/cars endpoint to scan exterior_color, spoiler_type, and wheel_type with NullString so the endpoint stays resilient until TeslaMate populates the profile.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@sonarqubecloud

sonarqubecloud Bot commented Jul 7, 2026

Copy link
Copy Markdown

@tobiasehlert tobiasehlert self-assigned this Jul 7, 2026
@tobiasehlert tobiasehlert changed the title Handle NULL car profile fields in /api/v1/cars fix: handle NULL car profile fields in /api/v1/cars Jul 7, 2026
@tobiasehlert tobiasehlert added the go Pull requests that update Go code label Jul 7, 2026
@tobiasehlert
tobiasehlert merged commit 7b02555 into main Jul 7, 2026
2 checks passed
@tobiasehlert
tobiasehlert deleted the not-support-2026-model-y-with-glacier-bl branch July 7, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: fresh setups can fail before profile data is populated

1 participant