ukwa / w3act

w3act is an annotation and curation tool for building web archive collections
Apache License 2.0
19 stars 6 forks source link

Review how Documents are handled upon deletion of WatchedTarget records #666

Closed anjackson closed 2 years ago

anjackson commented 2 years ago

The current implementation ensures that when a Target is no longer Watched, and the WatchedTarget record is removed, this deletion is cascaded to the child Documents. See e.g.

https://github.com/ukwa/w3act/blob/6ad35fff95854edd847c279904534938ff73295d/app/models/WatchedTarget.java#L38-L39

It is not clear if this is the desired behaviour. This needs to be clarified with @nicolabingham and then if we do want to keep the documents, we need to investigate if we can retain all records while still allowing the Watched status to be switched on and off.

Due to the complex relatioships between tables, it may make more sense to switch Watched status to a simple boolean true/false flag, and then create the entity relationships when a Target is first Watched (but use the flag to decide how to present the Target in the UI).

nicolabingham commented 2 years ago

I will check with Jennie about this, however I think the desired behaviour is that when a Watched Target is switched off, the child documents remain on the system for processing but no new documents are added.

anjackson commented 2 years ago

Hi @nicolabingham I think we found Jenny was fine with deleting them all (the current behaviour). Are you okay with that, or shall we change it so Watched Targets are just deactivated rather than deleting?

nicolabingham commented 2 years ago

Hi @anjackson yes, that's fine to keep the current behaviour (deleting the documents). Thanks.

anjackson commented 2 years ago

Thanks!