DirectionsService CORS fallback toast is immediately cleared by loadSampleDirections #1009

Closed
opened 2026-08-12 07:06:57 +00:00 by spikerj · 1 comment
Owner

Summary

When getDirections() hits a CORS / Failed-to-fetch / Network-request-failed error, it sets error to the mapTracker.runtime.directionsCorsFallback message, then immediately calls loadSampleDirections().

loadSampleDirections() always writes error: null when applying the sample route, so the user never sees the CORS fallback explanation — only the sample route appears with a cleared error.

Location

projects/spikersoft/src/app/_components/map-tracker/services/directions.service.ts — getDirections catch branch + loadSampleDirections.

Expected

Either keep the CORS notice while showing sample data (e.g. do not null error in the sample path when invoked as a fallback), or surface a distinct "showing sample directions" banner.

Characterization

Pinned in directions.service.spec.ts (Wave 6 tick 6 / a2): after a CORS throw, currentRoute is non-null and error is null.

Source

Wave 6 coverage LOOP tick 6 — agent a2.

## Summary When `getDirections()` hits a CORS / Failed-to-fetch / Network-request-failed error, it sets `error` to the `mapTracker.runtime.directionsCorsFallback` message, then immediately calls `loadSampleDirections()`. `loadSampleDirections()` always writes `error: null` when applying the sample route, so the user never sees the CORS fallback explanation — only the sample route appears with a cleared error. ## Location `projects/spikersoft/src/app/_components/map-tracker/services/directions.service.ts` — `getDirections` catch branch + `loadSampleDirections`. ## Expected Either keep the CORS notice while showing sample data (e.g. do not null `error` in the sample path when invoked as a fallback), or surface a distinct "showing sample directions" banner. ## Characterization Pinned in `directions.service.spec.ts` (Wave 6 tick 6 / a2): after a CORS throw, `currentRoute` is non-null and `error` is null. ## Source Wave 6 coverage LOOP tick 6 — agent a2.
Author
Owner

Fixed in spikersoft-angular PR #823 (a0f0ccd9). Closing.

Fixed in `spikersoft-angular` [PR #823](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/823) (`a0f0ccd9`). Closing.
Sign in to join this conversation.