splashblot / dronedb

Location Intelligence & Data Visualization tool
http://carto.com
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Changing basemap to a solid color fails #89

Closed apercas closed 7 years ago

apercas commented 7 years ago

Steps to Reproduce

Create a new map with a by-default basemap and a dataset

  1. Change basemap and select a plain color
  2. Reload
  3. The basemap is still the same

Current Result

Although the sidebar says the basemap is actually a plain solid color, the model vis.map.layers.models[0] wouldn't change

Expected result

Update the model correctly after changing the map and updating

Browser and version

Currently experienced in branch tileo-feature/raster (running in beta) while updating a map with either a raster or a vector layer in it

apercas commented 7 years ago

It happens using the tileo branch as well (in beta)

apercas commented 7 years ago

We seem to be unable to reproduce this other than in beta, whatever the branch is in use.

ivanprado commented 7 years ago

I have been investigating. It seems that the visualization shown in the builder is created from a vizJSON that is generated at rails (See: https://github.com/splashblot/dronedb/blob/tileo/app/views/carto/builder/visualizations/show.html.erb#L11). The vizJSON is built here: https://github.com/splashblot/dronedb/blob/tileo/app/controllers/carto/api/vizjson3_presenter.rb#L61. As can be seen, vizjsons are cached on redis with an expiry date of 24 hours. But also on change it should be expired. So changes should trigger cache invalidation. That can be seen for example here: https://github.com/splashblot/dronedb/blob/tileo/app/models/carto/visualization.rb#L109

Well, that's the theory. I have seen that it is not working at beta. I mean, visualization changes doesn't invalidate cache... And this is the reason why changes are not reflected when exiting and returning to the visualization. I have tested to remove the cached vizjsons at redis and the visualization shows the proper basemap.

Why this is happening only at beta when code is the same is still a mystery.

image

Anyway, as not affecting development nor production, let's just ignore it by now.