-
Notifications
You must be signed in to change notification settings - Fork 105
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
Fix duplicate check element for instances and variables #285
Fix duplicate check element for instances and variables #285
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nitram509 thank you for the contribution 🎉
It looks good. Please rebase the PR on the latest changes and check my comments.
return Schema.ProcessInstanceRecord.newBuilder() | ||
.setElementId(elementId) | ||
.setMetadata(Schema.RecordMetadata.newBuilder() | ||
.setIntent(ProcessInstanceIntent.ELEMENT_ACTIVATED.name())) | ||
.build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could set the partition id and the position of the record. This would make the behavior more explicit. Like in the other test case.
import org.springframework.test.context.support.AnnotationConfigContextLoader; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@RunWith(SpringJUnit4ClassRunner.class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please migrate the tests to JUnit 5.
For example, replace @RunWith(SpringJUnit4ClassRunner.class)
with @SpringBootTest
.
@saig0 it seems I messed up the rebase ... still working on this PR to get rid of the merge conflict. |
This solution favors creating new ID, based on a composition of partitionId and position. See comments in PR camunda-community-hub#280 and Issue camunda-community-hub#278 for more details. Tests are added to show implementation works properly Unfortunately, because of JPA requires an @id field, a new field was introduced and there's an UPGRADE instruction documented, so people out there would be able to migrate their installations.
add partitionId and position as recommended, camunda-community-hub#285 (review)
fb25b9d
to
f38ceda
Compare
@saig0 OK, I fixed it. Sorry for any previous confusion, I did force push on my branch and now this PR has the latest changes from master included. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Based on the discussion in PR #280,
this is the actual bug fix for issue #278.
This PR depends on #284, because of the author's preference to split #280 into separate PRs.
This bug fix uses the approach of transient creation of an ID, based on PartitionID and Position.
Also, tests are added, to show how it works.
The duplicate check is implemented again.