perf(web): IndexedDB paint cache, shared freshness loader in list view, drop global Live Tracking#85
Merged
Merged
Conversation
…w, drop global Live Tracking Make the fleet views cheaper against DIMO APIs (~500-vehicle tenants) and faster to paint on cold load: - FleetCache now writes through to IndexedDB (idb-keyval, one snapshot per tenant, 24h max age). Map and list views paint instantly from the last snapshot on a hard reload, then always revalidate against /vehicles — paint-only, server wins; markers for vehicles no longer in the fleet are pruned after a persisted paint. - fleet-list-view drops its private always-pull-everything location fan-out for the shared seedLocationsFromDb + fetchFleetLocations, so it now respects the 5-min locationPulledAt freshness window instead of re-pulling every vehicle on each visit. - Remove the global "Live Tracking" button (top bar + map legend): it force- refreshed the entire fleet every 60s, bypassing both the freshness window and the backend 45s cache. Per-vehicle live tracking stays via the quick-view "Real-time · 20s" toggle. Live-verified against the 430-vehicle fleet: zero /telemetry/locations on reload within the window, partial refresh re-pulls only stale vehicles, force refresh still re-pulls all, expired snapshots ignored gracefully. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UxoaxTXSLqUwkYfewdwGBM
The committed bundle lost the two eslint-disable comments during a local stash round-trip, tripping CI's localize drift check. Regenerated via npm run localize; no message changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UxoaxTXSLqUwkYfewdwGBM
JamesReate
added a commit
that referenced
this pull request
Jul 10, 2026
Ships #85 (IndexedDB paint cache, shared freshness loader in list view, remove global Live Tracking) and #86 (vehicles.vin backfill from the DIMO VIN VC). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UxoaxTXSLqUwkYfewdwGBM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
For a ~500-vehicle tenant the fleet views were generating avoidable DIMO telemetry load, and cold loads waited a full network round-trip before painting anything:
locationPulledAtfreshness window and the backend 45s cache (~500 telemetry queries/min while enabled)./vehiclesreturned.What
FleetCache→ IndexedDB write-through (idb-keyval, keyfleet:${tenantId}, 24h max age). Map and list views paint instantly from the last snapshot on cold load, then always revalidate:/vehiclesstill fetched, stale-only fan-out still runs, server data replaces the paint. Markers are pruned after a persisted paint so removed vehicles don't ghost.invalidate()also deletes the persisted entry.seedLocationsFromDb+fetchFleetLocations), so it respects the 5-min window and streams stale-only — identical backend load profile to the map view.locationPulledAt, shared across users/devices — deliberately not moved client-side).LOCATION_REFRESH_PLAN.mdstatus updated (was still "pre-implementation").Verification (live, 430-vehicle James Fleet tenant)
/vehicles200, zero/telemetry/locationsrequeststscclean, ESLint 0 errors, localize extract/build regenerated (only the 3 removed strings)🤖 Generated with Claude Code
https://claude.ai/code/session_01UxoaxTXSLqUwkYfewdwGBM