How to Detect Entity Changes in Drupal the Right Way
The following code snippets should be compatible with Drupal 10+.
Challenges in detecting meaningful entity changes
One working with entities in Drupal answering of the following seemingly simple questions can pose a challange:
Has this entity meaningfully changed since its last revision? Has it changed meaningfully since it was last saved?