umap-project / umap

uMap lets you create maps with OpenStreetMap layers in a minute and embed them in your site.
https://umap-project.org
Other
1.19k stars 226 forks source link

chore: introduce SaveManager class #2240

Closed yohanboniface closed 2 weeks ago

yohanboniface commented 2 weeks ago

The last refactor of the save process (0fdb70ce669838f9fd66eb5de570ffde78e3653d) has introduced a bug: the save flow was not more stopped when a layer fail to save. This ends with a broken UI, as the map is not dirty anymore, so the save button is not active anymore, while at least one layer still needs to be saved.

Save can fail in two scenarios:

I tried a more modest scenario (listening for status in map.save and recallign the map save after a conflict), but this ended with calling map.save uselessly even more.

So I decided to try this refactor, which also totally remove the useless map.save we were sending at each save until now.