mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-06 10:44:23 +00:00
fix(client): narrow the route profile and Valhalla answer types, keep the stop check reading the whole log
The built-in profile check returned the open profile key and the run request returned an unnarrowed answer, both of which the client typecheck refused. The new road trip tests asserted with non-null assertions where optional calls do. The graceful stop step piped docker logs into grep -q under pipefail, so grep leaving early after its match could fail the step with SIGPIPE although the server had logged SIGTERM.
This commit is contained in:
@@ -738,7 +738,8 @@ async function requestRun(
|
||||
): Promise<Omit<ValhallaRun, 'snapped'> | ValhallaNoPath | TooSlow | null> {
|
||||
const body = routeBody(waypoints, profile, avoid, costingOptions, searchFilter)
|
||||
const data = await postRoute(base, body, signal, publicFallback)
|
||||
if (data === NO_PATH || tooSlow(data)) return data
|
||||
if (data === NO_PATH) return NO_PATH
|
||||
if (tooSlow(data)) return data
|
||||
return data === null ? null : runFrom(data)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user