osmose-frontend
osmose-frontend copied to clipboard
Automatically detect classes where the backend code has been removed, but the detections still exist on the frontend
From https://github.com/osm-fr/osmose-backend/issues/1732
After a certain class has been removed from the backend (for example: after a mapcss update that removed the corresponding rule), the previously detected issues remain on the frontend unless manually detected and removed.
Ideally there should be a warning and/or automatic cleaning of such "ghost classes".
Here we have one real case https://github.com/osm-fr/osmose-backend/issues/1735
Maybe we can use the output of backend/osmose_config.py and compare with data base content (but there is external analysers).
@jocelynj better idea?
I see we have a "timestamp" column on table "class" on frontend. Could it be used to remove old classes?
I see we have a "timestamp" column on table "class" on frontend. Could it be used to remove old classes?
Right. But it solves only one part of the issue. The timestamp is update each time the class get an update. But we have sources/country with removed classes, but not for all countries.
Nevertheless, it is interesting to see we have so much old classes!
select item, class, title->>'en', timestamp from class where timestamp < now() - interval '2 months';
Got 809 rows!
select item, array_agg(DISTINCT class) as classes, max(title->>'en') as title, max(timestamp) as timestamp from class where timestamp < now() - interval '2 months' group by item;