IsraelHikingMap / Site

Israel Hiking Map has maps, route planning, and travel information for Israel. This repository holds the files needed for running the Israel Hiking Map site and apps.
https://israelhiking.osm.org.il/
Other
84 stars 33 forks source link

Starting a second recording doesn't clear the previous recording #2033

Closed HarelM closed 3 weeks ago

HarelM commented 1 month ago

What happened?

When starting a second recording at the same "session" the recording is not presented well.

What steps will reproduce the bug?

  1. Start a recording
  2. Stop the recording
  3. Start a new recording

What I expect to happen

The second recording should be presented well

Platform

OS Name and Version

Android 14

Browser Name and Version

N/A

Additional information

I'm getting the following error in the app log right after starting the second recording:

Error: Source "recorded-route-last-segment-geojson" already exists.
    at Za.addSource (http://localhost/main.0012ab19f8bafd8d.js:1:4726928)
    at v.Map.addSource (http://localhost/main.0012ab19f8bafd8d.js:1:5010359)
    at http://localhost/main.0012ab19f8bafd8d.js:1:1070235
    at u.invoke (http://localhost/polyfills.c7f57e48d6522582.js:1:19248)
    at N.run (http://localhost/polyfills.c7f57e48d6522582.js:1:14510)
    at Le.runOutsideAngular (http://localhost/main.0012ab19f8bafd8d.js:1:63848)
    at t.addSource (http://localhost/main.0012ab19f8bafd8d.js:1:1070141)
    at t.addSource (http://localhost/main.0012ab19f8bafd8d.js:1:1076646)
    at Object.next (http://localhost/main.0012ab19f8bafd8d.js:1:1077432)
    at r.subscribe.l (http://localhost/main.0012ab19f8bafd8d.js:1:313016)
2024-09-27 17:18:30 |  INFO | [Record] Starting recording

This might be an issue with the ngx-maplibre wrapper for version 18/SSR where the source is not cleaned correctly.

I'll need to see if I can create a minimal reproduction.

Workaround - close the app and open it again. Cc: @zstadler - in case you have the latest app installed, I'm not sure this is what users currently have or this is the version that is currently in main with all the packages updates.

zstadler commented 1 month ago

The issue exists at the latest internal testing version, 9.20.198

HarelM commented 1 month ago

The root cause of this issue is the following:

I'll fix it there and publish a new version.

HarelM commented 3 weeks ago

This was fixed and published in the plugin code. Closing.