Delete attached photos when a feature is deleted

#4727 · open · 1 comments

View on GitHub ↗

gabriel-bolbotina

### Current situation When a feature is deleted, its attached photos stay on the device and in the project. This leaves unused files behind, and with the composition relation supported (https://github.com/MerginMaps/mobile/issues/2315) more features will be deleted automatically, so more orphaned photos could pile up. ### Proposed solution When a feature is deleted, delete its attached photos as well. This also applies to child features deleted through a composition relation (for example, if a parent feature is deleted, then its children should be deleted as well) ### Acceptance criteria - Deleting a feature deletes its attached photo(s) - Deleting a parent with composition children deletes the photo(s) of all deleted child features (including nested ones) - If child features are created while adding a parent, and the parent is discarded without saving, the photos of those child features are deleted too - Deleting a parent with association children does not delete the children's photos (and neither the children, check acceptance criteria of (https://github.com/MerginMaps/mobile/issues/2315) - when discarding a parent feature with composition children, the delete confirmation text mentioned that the attached photos will also be deleted Related to: https://github.com/MerginMaps/mobile/issues/2315

Comments

MF-Aichinger

@gabriel-bolbotina Are all child elements also deleted when the parent elements are deleted? Not right now, right?