Skip to content

List everything in a window, not the newest 5,000 - #104

Merged
blike merged 1 commit into
mainfrom
uncap-windowed-listings
Nov 9, 2026
Merged

blike merged 1 commit into
mainfrom
uncap-windowed-listings

Conversation

@blike

@blike blike commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

When drives or charging sessions are listed for a date window, the server returns only the newest
5,000 and drops the rest without saying so. Over a long window, History then undercounts its totals
and draws the oldest bars empty. Fixes #102.

With a window, every row in it now comes back, from RivianMate's database and from TeslaMate.

Listings with no window still return 200 at a time. That's paging, not a cap: the Drives and
Charging pages load the next 200 with before as you scroll.

Testing

  • Unit tests added/updated: 5,001 drives and 5,001 sessions in a window all come back, oldest
    included.
  • Integration tests passed: server suite against Postgres.
  • Existing tests passed.

An all-time listing against a TeslaMate car with 6,421 drives takes 0.4 s and returns 5.9 MB of
JSON before compression.

Deployment

  • No special deployment requirements

A listing asked for a date window stopped at 5,000 rows, newest first, so
anything older was dropped without a word. History's totals undercounted
and the earliest bars drew empty once a window held more drives than that;
a TeslaMate car with 6,421 drives already loses its oldest 1,421 over its
whole history.

With a window, drives and charging sessions now come back in full, from
RivianMate's database and from TeslaMate. Without one they still come a
page of 200 at a time. Trip candidates, which used the same cap, are
uncapped too.

Fixes #102
@blike
blike force-pushed the uncap-windowed-listings branch from d29c78f to 45b1e60 Compare November 9, 2026 00:44
@blike
blike merged commit 921c0d3 into main Nov 9, 2026
1 check passed
@blike
blike deleted the uncap-windowed-listings branch November 9, 2026 00:52
@blike blike mentioned this pull request Nov 9, 2026
3 of 4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windowed listings return at most 5,000 rows

1 participant