Skip to content

feat(core): fix duplicate issue with auditing#95

Open
RVANDO12 wants to merge 3 commits into
mainfrom
feat/audit/fix-duplicate
Open

feat(core): fix duplicate issue with auditing#95
RVANDO12 wants to merge 3 commits into
mainfrom
feat/audit/fix-duplicate

Conversation

@RVANDO12

Copy link
Copy Markdown
Collaborator

PR Description

Issue when batch update of relation between entity.

" Caused by: java.sql.BatchUpdateException: Batch entry 1 insert into idp_core.relation_target_entities_aud "
" ERROR: duplicate key value violates unique constraint "relation_target_entities_aud_pkey"

Fixes

Database: Expand the relation_target_entities_aud_pkey to include target_entity_uuid.

Code: Strip targetEntityUuid out of the equals() and hashCode() methods in RelationTargetJpaEntity.java so that the Java Set correctly prevents duplicates before they ever reach Hibernate Envers.

Review

The reviewer must double-check these points:

  • The reviewer has tested the feature
  • The reviewer has reviewed the implementation of the feature
  • The documentation has been updated
  • The feature implementation respects the Technical Doc / ADR previously produced
  • The Pull Request title has a ! after the type/scope to identify the breaking
    change in the release note and ensure we will release a major version.

How to test

Update a huge information about entity to cause the issue and check is not appears

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: Java

Java / code-coverage/jacoco

The overall coverage in the branch remains at 90%, unchanged from the branch.

Show a code coverage summary of the most impacted files.
File a98cccd 4464f69 +/-
com/decathlon/i...enceMapper.java 73% 65% -8%

Code Coverage is in Public Preview. Learn more and provide us with your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant