flowable / flowable/flowable-engine

The DefaultIdentityLinkIterceptor.java creates duplicate identityLinks on ProcessInstance

Offen
#3,900 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
9.5k
Forks
2.9k
Ø Merge
7 Std. 8 Min.
Gemergte PRs (30 T.)
2

Beschreibung

**Describe the bug**
The DefaultIdentityLinkIterceptor.handleCompleteTask method creates a new PARTICIPANT IdentityLink on the ProcessInstance the tasks belongs to every time a task completes.

**Expected behavior**
There should be a check if such an IdentityLink already exists before creating it. This is done in some of the other methods in the class by calling the addUserIdentityLinkToParent which does such a check.

Noticed that we had a lot of duplicates in the IdentityLink-tables for processes with a lot of tasks.

**Code**
```
public void handleCompleteTask(TaskEntity task) {
if (Authentication.getAuthenticatedUserId() != null && task.getProcessInstanceId() != null) {
ExecutionEntity processInstanceEntity = CommandContextUtil.getExecutionEntityManager().findById(task.getProcessInstanceId());
IdentityLinkUtil.createProcessInstanceIdentityLink(processInstanceEntity,
Authentication.getAuthenticatedUserId(), null, IdentityLinkType.PARTICIPANT);
}
}
```

**Additional context**
This is present on the main branch.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne in DefaultIdentityLinkIterceptor.java bei handleCompleteTask und vergleiche dessen Verhalten mit den benachbarten Methoden, die addUserIdentityLinkToParent aufrufen. Überprüfe, wie ein vorhandener PARTICIPANT-IdentityLink erkannt wird, und bestätige anschließend, dass das Abschließen mehrerer Tasks für dieselbe Prozessinstanz keine doppelten Links erzeugt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
backend
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.