osmose-frontend icon indicating copy to clipboard operation
osmose-frontend copied to clipboard

Automatically detect classes where the backend code has been removed, but the detections still exist on the frontend

Open Famlam opened this issue 1 year ago • 3 comments

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".

Famlam avatar Jan 21 '23 19:01 Famlam

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?

frodrigo avatar Feb 09 '23 22:02 frodrigo

I see we have a "timestamp" column on table "class" on frontend. Could it be used to remove old classes?

jocelynj avatar Feb 09 '23 22:02 jocelynj

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;

frodrigo avatar Feb 10 '23 23:02 frodrigo