Skip to content

DynamicLabels include non-dynamic label #2619

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

Closed
SaschaPeukert opened this issue Oct 26, 2022 · 3 comments
Closed

DynamicLabels include non-dynamic label #2619

SaschaPeukert opened this issue Oct 26, 2022 · 3 comments
Assignees
Labels
type: bug A general bug

Comments

@SaschaPeukert
Copy link

Given:

@Node("Metric")
public abstract class Metric {
	@DynamicLabels
    public List<String> dynamicLabels;
	
	...
}

@Node("Counter")
@Value
public class CounterMetric extends Metric {
	...
}

And a test something like this:

...

var c = new CounterMetric(...);
c.dynamicLabels.add("Test");
save(c)
...
var retrievedCounter = load(counter)
...

It appears that dynamicLabels now include "Test" and "Counter" which is not ideal.

Seen with spring-boot 2.6.13 which uses spring-data-neo4j 6.2.9, I think

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 26, 2022
@SaschaPeukert
Copy link
Author

SaschaPeukert commented Oct 26, 2022

Update: from what I see in our tests, this only happens sometimes (25% - 50% of runs), making it very annoying to deal with

@michael-simons michael-simons self-assigned this Oct 27, 2022
@michael-simons michael-simons added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 27, 2022
@michael-simons
Copy link
Collaborator

IDK yet if relevant or not, but do these entities have @Id @GeneratedValue Long ids (internal neo4j) or are you using UUID or similar?

michael-simons added a commit that referenced this issue Oct 27, 2022
In case another matching node description is found, the value of the `mostMatchingStaticLabels` must be updated.

Fixes #2619.

# Conflicts:
#	src/test/java/org/springframework/data/neo4j/integration/reactive/ReactiveDynamicLabelsIT.java

# Conflicts:
#	src/main/java/org/springframework/data/neo4j/core/mapping/NodeDescriptionStore.java
michael-simons added a commit that referenced this issue Oct 27, 2022
In case another matching node description is found, the value of the `mostMatchingStaticLabels` must be updated.

Fixes #2619.

# Conflicts:
#	src/test/java/org/springframework/data/neo4j/integration/reactive/ReactiveDynamicLabelsIT.java
michael-simons added a commit that referenced this issue Oct 27, 2022
In case another matching node description is found, the value of the `mostMatchingStaticLabels` must be updated.

Fixes #2619.
@michael-simons
Copy link
Collaborator

Thanks @SaschaPeukert for the report. This is fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants