MarksRouteService leaves a stale route when Directions returns no result #1063

Closed
opened 2026-08-13 06:02:11 +00:00 by spikerj · 1 comment
Owner

Wave 7 tick 5 a3 coverage of MarksRouteService.calculateRoute.

Where: projects/spikersoft/src/app/_services/marks-site/marks-map/marks-route.service.ts

What: After a successful calculateRoute(), a later call whose Directions observable emits { result: undefined } (no throw) does not clear directionsResults$ and does not call setShowDirections(false). The previous polyline stays on the map with no error dialog.

The thrown-error path correctly shows messageDialog.error(...) and skips the cache. The empty-result path is silent.

Would have caught: subscribe handler if (result) { set; show } with no else to hide/clear.

Repro (unit): seed a successful result, then mock MapDirectionsService.route to of({ result: undefined }) and call calculateRoute() again — cached result is still the first route.

Wave 7 tick 5 a3 coverage of `MarksRouteService.calculateRoute`. **Where:** `projects/spikersoft/src/app/_services/marks-site/marks-map/marks-route.service.ts` **What:** After a successful `calculateRoute()`, a later call whose Directions observable emits `{ result: undefined }` (no throw) does **not** clear `directionsResults$` and does **not** call `setShowDirections(false)`. The previous polyline stays on the map with no error dialog. The thrown-error path correctly shows `messageDialog.error(...)` and skips the cache. The empty-result path is silent. **Would have caught:** subscribe handler `if (result) { set; show } ` with no `else` to hide/clear. **Repro (unit):** seed a successful result, then mock `MapDirectionsService.route` to `of({ result: undefined })` and call `calculateRoute()` again — cached result is still the first route.
Author
Owner

Already present on spikersoft-angular master. Empty Directions results call clearDirections(), so a failed follow-up route no longer leaves a stale polyline. Closing.

Already present on `spikersoft-angular` `master`. Empty Directions results call `clearDirections()`, so a failed follow-up route no longer leaves a stale polyline. Closing.
Sign in to join this conversation.