Repository navigation
Conversation
|
Hey Hiral — good progression from #180. The traffic layer is well-structured: the feature-flag defaults are safe, the env variable naming is consistent, the threshold logic mirrors the weather path cleanly, and the new unit tests cover the traffic path well ( A few things to work through before merge: Must-fix
Worth fixing
Frontend carryovers from #180
The event-loop threading fix is the one I'd want to see before this merges. Everything else can be sequenced, but the leg-loop blocking is a regression in server availability under real traffic conditions. Happy to talk through the async approach if that's helpful. |
74e14fe to
9728bca
Compare
df30825 to
d69889d
Compare
|
Good iteration — all three must-fixes from the last round are in and clean. The thunder double-count fix is especially nice, the A few new things surfaced: Worth fixing before merge
Lower priority
Frontend carryovers (same as last time, sequencing is fine): The job ID indexing one is the new must-look-at — everything else can be sequenced or documented. Happy to talk through the ID→position fix if useful. |
d69889d to
8bd8429
Compare
markboenigk
left a comment
There was a problem hiding this comment.
Code review (medium effort) — 2 blocking perf/correctness issues, 1 cleanup item
CI is green and the PR is mergeable. The traffic delay math, weighted service-time distribution, and leg-departure heuristics are well unit-tested, and the frontend changes (phone-call link, driver-assist summary auto-refresh, dead warning button removal) are clean, self-contained improvements. However, two issues in the traffic-forecast pipeline should be addressed before merging:
Blocking:
-
app/api/src/forecast_optimizer.cpp:641—ReadRouteTrafficfetches Google Maps traffic delay for every route leg sequentially and synchronously, each call blocking up tokGoogleMapsTimeoutSeconds+1(5s). A route with 20+ stops produces 19+ legs; if Google Maps is slow/unreachable, eachFetchTrafficDelaycall blocks ~5s before falling back, so the traffic step alone can add 1-2+ minutes of latency to every optimize response. Suggest firing the per-leg calls concurrently (small thread pool) or switching to a batched Distance Matrix request. -
app/api/src/endpoints/deliveries_optimize_endpoint.cpp:143—FinishWithTrafficspawns a new detachedstd::threadfor every completed weather solve, unconditionally (even whenDELIVERYOPTIMIZER_TRAFFIC_FORECAST_ENABLEDis unset, the default), with no bound tied to the existingSolveCoordinatoradmission control. Under load this creates OS threads outside the coordinator's queueing/admission limits — combined with #1, many concurrent large routes can pile up long-lived native threads that the coordinator was designed to prevent.
Non-blocking cleanup:
app/api/src/forecast_optimizer.cpp:539—FetchTrafficDelayre-implements the sameHttpClient+ promise/future + timeout pattern already used byFetchOpenWeatherDelayEstimate(lines 205-267) almost verbatim. Worth sharing a helper so future fixes to the blocking-HTTP-with-timeout pattern don't have to be made twice.
4aa809b to
1282d06
Compare
Review: Traffic-aware route forecast (#181)Nice feature. A few blocking issues around fallback behavior and a client-side render loop, plus some cleanups. Blocking1. Infinite render loop on the driver summary screen — 2. Failed traffic re-optimization discards an already-good route — 3. Out-of-range
Google Distance Matrix requires Non-blocking4. Duplicated traffic post-processing orchestration — 5. Misleading 6. Call control lost button semantics — |
fde99ec to
f8ce573
Compare
|
The traffic forecast work looks well-structured — the largest-remainder distribution, the Blocking: please split this PRThe body describes traffic forecasting, but the diff is 51 files / 3,315 insertions, and 8 of those files are Those UI commits are rebased copies of the ones in #174 — same headlines, different SHAs ( and it carries two UI commits #174 doesn't have ( Ask: drop the UI commits from this branch and let #174 own that work. I'll review the API half here. I can't usefully review the driver_assist changes in two places simultaneously, and neither can you maintain them. Blocking: the sync path blocks completion workers on Google
On the sync path that runs inside a The fix template is already in this file.
Traffic has no equivalent — line 154 passes Acceptance: an integration test in the shape of the existing Separately worth confirming before rollout: at one Distance Matrix element per leg, each optimize call bills N+1 elements. Is that costed? Blocking: an exception in the worker thread aborts the processThe Before this PR the equivalent code ran on the request thread, where it could at least unwind. Acceptance: Should fix before merge
Not blocking
Both are in the UI half; they travel with #174 if you split as asked. Checked and clean — no need to revisit
What I'd like backThe split first — once the UI commits are gone I'll re-read the API half in one pass. Then the sync-path guard and the |
|
This branch is an ancestor of both |
Summary
Motivation
Changes
Backend:
Infrastructure:
Validation
Frontend
npm --prefix app/ui run lintnpm --prefix app/ui run format:checknpm --prefix app/ui run typechecknpm --prefix app/ui run testnpm --prefix app/ui run buildnpm --prefix app/mobile run lintnpm --prefix app/mobile run typecheckBackend
cmake --preset dev.github/scripts/check-backend-static.sh build/devcmake --build --preset conan-release --parallelgit diff --checkdocker compose -f deploy/compose/docker-compose.arm64.yml --env-file deploy/env/http-server.arm64.env configcmake --build --preset dev --parallelctest --preset dev --output-on-failure --no-tests=error -LE 'e2e|docker'Risk
Rollout and Recovery
DELIVERYOPTIMIZER_TRAFFIC_FORECAST_ENABLED=1and settingGOOGLE_MAPS_API_KEY.DELIVERYOPTIMIZER_TRAFFIC_FORECAST_ENABLEDto0)High-Signal PR Checklist