flowable / flowable/flowable-engine
The DefaultIdentityLinkIterceptor.java creates duplicate identityLinks on ProcessInstance
- 主要言語
- Java
- スター
- 9.5k
- フォーク
- 2.9k
- 平均マージ
- 7時間 8分
- マージ済み PR(30日)
- 2
説明
**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.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
DefaultIdentityLinkIterceptor.java の handleCompleteTask から始め、addUserIdentityLinkToParent を呼び出す周辺のメソッドとその動作を比較してください。既存の PARTICIPANT IdentityLink がどのように検出されるかを確認し、その後、同じプロセスインスタンスで複数のタスクを完了しても重複したリンクが作成されないことを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 55/100