Reindexing is skipped when a contained entity change follows a change that is irrelevant to indexing

Description

We have this code in PojoIndexedTypeIndexingPlan:

The if condition is presumably only there for performance, but:

  1. I doubt it improves performance by a lot, since getState( identifier ).updateBecauseOfContained( entitySupplier ); doesn't do much when the state already exists.

  2. I believe it's wrong. If we create a state for some benign change (such as an update to a property that is not indexed), and then end up in this method because a contained entity has changed, then we will skip reindexing.

We should:

  1. Add a test for this.

  2. Remove the if to fix the problem.

  3. Maybe, in a follow-up ticket, prevent the creation of a state for updates that are not relevant to indexing?

Environment

None
Fixed

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Priority

Major