Currently, the Add Link task pool system ignores the "page is deleted" event. This causes dangling recommendations that are completely unaccounted for:
- revalidateLinkRecommendations.php skips them (LinkRecommendationStore::getAllExistingRecommendations ignores rows for deleted pages)
- fixLinkRecommendationData.php (for handling dangling records) mis-represents them as "good" (LinkRecommendationStore::listPageIds has deleted pages, but searching for -hasrecommendation:link pageid:XXX when XXX is a deleted page ID will never produce any results, as a deleted page has no search document at all; a "no query result" is interpreted as "good page")
Those rows should be likely deleted on page deletion (and ideally, also by some sort of a maintenance script, to account for the dangling rows). Even if the page was undeleted, we'd never have the recommendation back in search, so undeletion would at best make the entry dangling (until we eventually run the fix script).