NUKnightLab / StoryMapJS

Maps that tell stories.
https://storymap.knightlab.com/
Other
183 stars 50 forks source link

Storymap deletion assumes maximum number of keys #456

Closed JoeGermuska closed 2 years ago

JoeGermuska commented 3 years ago

I just happened to be looking at the code for /storymap/delete/ and I see that it arbitrarily assumes that a storymap to be deleted will never have more than 50 associated files stored.

https://github.com/NUKnightLab/StoryMapJS/blob/master/api.py#L493-L511

While this is de facto probably fine, it seems unnecessary to run the risk that a very large storymap would not be correctly deleted (or one for which someone has uploaded extra media in the course of developing the storymap)

Preferably, we'd delete everything without a limit.

scott2b commented 2 years ago

Updating the code link. There still appears to be a 50 key limit imposed on the fetch from S3.

https://github.com/NUKnightLab/StoryMapJS/blob/master/storymap/api.py#L527

scott2b commented 2 years ago

An async task now handles asset cleanup for an arbitrary number of keys.