mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-21 22:46:32 +00:00
fix(planner): scheme-check the booking URL, and stop the serial routing calls
A booking's url is rendered as a plain href to every other member of the trip and nothing ever checked its scheme, so a collaborator could store javascript: there. The place website next to it has been going through safeHttpUrl for exactly this reason, with a comment saying stored values predate the server check - this is the surface that was left. Both ends now: safeHttpUrl at the render site, and the scheme in the shared contract so nothing new gets stored, additively so existing rows still load. The per-leg routing rewrite turned one multi-waypoint request per run into one serial request per leg. A twelve-stop day is eleven round trips to a public OSRM in sequence before a single connector appears, and toggling km/mi does it all again. Group consecutive legs that resolve to the same mode into one request and fire the groups concurrently, keeping leg order on the join. Transport reordering wrote to the store and persisted with a bare catch, so a failed PUT left the sidebar showing an order the server never got; it reconciles now. Plus the smaller ones: the OSM menu_url rendered unchecked, expand/collapse-all persisting to a different storage than the day list reads, the debounced address search with no ordering guard, the accommodation save chain with no error path, and window.__trek_map holding a destroyed map.
This commit is contained in:
@@ -1696,6 +1696,15 @@ describe('MapViewGL', () => {
|
||||
expect(glMap.remove).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('FE-COMP-MAPVIEWGL-069: unmounting lets go of the window debug handle', async () => {
|
||||
const { unmount } = render(<MapViewGL places={[]} fitKey={1} />)
|
||||
await act(async () => {})
|
||||
expect((window as any).__trek_map).toBe(glMap)
|
||||
unmount()
|
||||
// Otherwise every style switch keeps its torn-down map reachable from window.
|
||||
expect((window as any).__trek_map).toBeUndefined()
|
||||
})
|
||||
|
||||
it('FE-COMP-MAPVIEWGL-059: pan and zoom report the visible bbox for the POI explore pill', async () => {
|
||||
const onViewportChange = vi.fn()
|
||||
render(<MapViewGL places={[]} fitKey={1} onViewportChange={onViewportChange} />)
|
||||
|
||||
Reference in New Issue
Block a user