[PDFHistory] Prevent the history from getting stuck in certain edge cases
Merge pull request #3507 from Snuffleupagus/PDFHistory-fix-multiple-identical-states

[PDFHistory] Prevent the history from getting stuck in certain edge cases