Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to detect new value object in a set under specific circumstances #795

Closed
robfletcher opened this issue Feb 25, 2019 · 2 comments
Closed

Comments

@robfletcher
Copy link

@robfletcher robfletcher commented Feb 25, 2019

I'm comparing two objects whose topology looks like this:

Entity
- various simple properties
- Set<ValueObject1>

ValueObject1
- various simple properties
- ValueObject2

ValueObject2
- various simple properties

If I add a new ValueObject1 to the set on an entity that only differs from another already in the set by the ValueObject2 property then Javers detects no change.

I did some debugging and it seems ObjectHasher generates a state snapshot of each ValueObject1 where the ValueObject2 property is only represented by a path (and hence looks the same in every instance of ValueObject1 in the set). Thus the ValueObject2 does not affect the hash generated and Javers does not see the new element in the set.

Although I'm working in Kotlin, I created a Gist that demonstrates the issue using Groovy/Spock: https://gist.github.com/robfletcher/97ad78d06f15c92617d734d227218c01 using a simplified version of the model from my real project.

@robfletcher robfletcher changed the title Failure to detect new items in a set under specific circumstances Failure to detect new value object in a set under specific circumstances Feb 25, 2019
robfletcher added a commit to robfletcher/keel that referenced this issue Feb 25, 2019
Uncovered a bug, see javers/javers#795 so one of the tests currently fails.
robfletcher added a commit to robfletcher/keel that referenced this issue Feb 26, 2019
Uncovered a bug, see javers/javers#795 so one of the tests currently fails.
bartoszwalacik added a commit that referenced this issue Feb 27, 2019
failing test case
@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Feb 27, 2019

Hi, thanks for reporting a nice test case. I will check how we can fix it.

robfletcher added a commit to spinnaker/keel that referenced this issue Feb 27, 2019
Uncovered a bug, see javers/javers#795 so one of the tests currently fails.
bartoszwalacik added a commit that referenced this issue Mar 4, 2019
initial work
bartoszwalacik added a commit that referenced this issue Mar 5, 2019
complications
bartoszwalacik added a commit that referenced this issue Mar 6, 2019
more complications
bartoszwalacik added a commit that referenced this issue Mar 8, 2019
some tests fixes
bartoszwalacik added a commit that referenced this issue Mar 9, 2019
so close
bartoszwalacik added a commit that referenced this issue Mar 10, 2019
tests are green
bartoszwalacik added a commit that referenced this issue Mar 10, 2019
unused class
@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Mar 10, 2019

fix released in 5.2.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants