google / ground-platform

Ground hosted components: Web console, Cloud Functions, db config
http://groundplatform.org
Apache License 2.0
203 stars 86 forks source link

[LOI Editor] Importing LOIs for new unpublished job will end up having unassociated LOIs if user end up not publishing the job #1964

Closed DaoyuT closed 3 weeks ago

DaoyuT commented 2 months ago

For bug #1714, we did a quicker fix #1958 that shows LOIs imported for new unpublished job. However, if user don't publish the job after importing LOIs, those LOIs would still exist with no job associated to it. Although they won't be rendered in the map view since they don't belong to any valid job, it's still bad to have these useless data sitting in the database.

One solution is to delete these LOIs that don't belong to any valid job every time the user hits the publish button. On top of that we could also bundle the import/delete LOI action within the publish job action, like mentioned in bug #1714.

jcqli commented 2 months ago

Copying over more info from https://github.com/google/ground-platform/issues/1895:

When LOIs are imported for a job that is not published, they do not show up in the map as they are not associated with any jobs.

We can bundle the import/delete LOI action within the publish job action:

More context: https://github.com/google/ground-platform/issues/1714#issuecomment-2200410314

kenstershiro commented 3 weeks ago

From @rfontanarosa - this should be solved now when you click publish they get cleaned up