Classification: Bug Severity: Medium Effort: Small
The HistoryManager.purge() method in lib/galaxy/managers/histories.py (line 289) only cascades to HDAs, completely ignoring HDCAs:
- Non-celery path (lines 308-310): loops over
item.datasets(HDAs), never touchesitem.dataset_collections - Celery path (
purge_history_datasetsinlib/galaxy/celery/tasks.py, lines 126-177): bulk UPDATE targets onlyHistoryDatasetAssociationtable super().purge()(line 313): just marks the History row itself as purged viaPurgableManagerMixin-- no child content awareness
The individual content purge path in history_contents.py (lines 1470-1476) handles HDCAs correctly via DatasetCollectionManager.delete() -- this is specifically a gap in the history-level cascade.
After the HDA loop (line 310), add:
for hdca in item.dataset_collections:
if not hdca.deleted:
hdca.deleted = TrueAfter the HDA bulk update (~line 166), add a bulk UPDATE for HistoryDatasetCollectionAssociation setting deleted=True.
Note: HDCAs have no purged column -- only deleted and visible. Setting deleted=True is sufficient since the underlying HDA purging is already handled by the existing HDA loop.
- #14966 (closed) -- "(Permanently) deleting datasets has no (immediate) effect"
- PR #13935 (merged) -- "Bulk operations: more API tests & fixes"
lib/galaxy/managers/histories.py--HistoryManager.purge()(line 289)lib/galaxy/celery/tasks.py--purge_history_datasets()(line 126)