ConservationMetrics / map-packer

A Nuxt app to allow users to generate and manage offline map requests to mapgl-tile-renderer
MIT License
3 stars 0 forks source link

Add a delete button for offline map packages on the `MapDashboard` (and a warning modal about the implications) #10

Closed rudokemper closed 1 month ago

rudokemper commented 4 months ago

We need to add a delete button for map requests to trigger two actions:

  1. Delete the map request from the database. This is straightforward in map-packer; we can extend the backend to handle this.
  2. if status: SUCCESSFUL, also delete the file in storage. The user should be prompted by a warning modal about the implications of not being able to access the file again, as it will be permanently deleted.

Currently, MapPacker has no access to file storage, so this deletion might need to occur via a queue message received by mapgl-tile-renderer, which would check the provided filename and delete the corresponding file from storage (volume mount). @IamJeffG - thoughts on this?

One possible edge case is if the user deletes a map request with status: PENDING, and no file has been created yet, which could result in mapgl-tile-render producing an orphaned file. However, if we eventually mark all status: PENDING as failed after a reasonable timeframe (see proposed issue https://github.com/ConservationMetrics/map-packer/issues/19) then we can avoid this by only allowing the user to delete map requests with SUCCESSFUL or FAILED statuses.