History grid: fix logic to prevent deleting/purging a shared history
Merge stable