• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

teslamate-org / teslamate / 81070657831e87a50b2726bda9b3c694a3e36627
81%

Build:
DEFAULT BRANCH: main
Ran 05 Jul 2026 08:26AM UTC
Jobs 1
Files 81
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

05 Jul 2026 08:21AM UTC coverage: 80.86% (-0.1%) from 80.96%
81070657831e87a50b2726bda9b3c694a3e36627

push

github

web-flow
fix(vehicle): back off on Fleet API EXCEEDED_LIMIT responses (#5476)

* fix(vehicle): back off on Fleet API EXCEEDED_LIMIT responses

Tesla's Fleet API returns 403 {"error": "account disabled: EXCEEDED_LIMIT"}
when the app's rate limit is exceeded, but this response wasn't matched by
any specific clause in TeslaApi.Vehicle.handle_response/2, so it fell
through to the generic :unknown handler. That handler retries every
10-30 seconds depending on vehicle state, with no backoff - so once an
app hits this limit, TeslaMate keeps hammering the already-rate-limited
endpoint indefinitely instead of backing off, which can prolong the block.

This routes the EXCEEDED_LIMIT response through the existing
:too_many_request handling (the same path used for HTTP 429 responses),
backing off for 15 minutes instead. Tesla doesn't send a retry-after
header for this error, so 15 minutes is a fixed, conservative default.

* fix(vehicle): handle :too_many_request in list_vehicles! and fetch_strict

Testing the previous commit against a live EXCEEDED_LIMIT ban surfaced
two spots where {:error, :too_many_request, retry_after} was never
handled, even though this shape already existed for plain HTTP 429s:

- Vehicles.list_vehicles!/0 (called once at application boot) had no
  matching case clause, so a rate-limited "list vehicles" call crashed
  the whole application at startup - and with restart: always, that's
  a boot-crash-loop that keeps calling the rate-limited endpoint.
- Vehicle.fetch_strict/2 (used by the manual "suspend logging" action)
  had the same gap, which would crash that vehicle's process if
  triggered while rate-limited.

Both now fall back gracefully instead of crashing: list_vehicles! uses
its existing fallback_vehicles() (cached cars from the DB), and
fetch_strict returns {:error, {:too_many_request, retry_after}} in the
same {:error, reason} shape its one caller already expects.

0 of 3 new or added lines in 2 files covered. (0.0%)

1 existing line in 1 file now uncovered.

1956 of 2419 relevant lines covered (80.86%)

2972.53 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
88.24
-3.6% lib/teslamate/vehicles.ex
1
82.68
-0.12% lib/teslamate/vehicles/vehicle.ex

Coverage Regressions

Lines Coverage ∆ File
1
82.68
-0.12% lib/teslamate/vehicles/vehicle.ex
Jobs
ID Job ID Ran Files Coverage
1 81070657831e87a50b2726bda9b3c694a3e36627.1 05 Jul 2026 08:26AM UTC 81
80.86
GitHub Action Run
Source Files on build 81070657831e87a50b2726bda9b3c694a3e36627
  • Tree
  • List 81
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 81070657 on github
  • Prev Build on main (#2D449379...)
  • Next Build on main (#979F70BD...)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc