Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ public enum Type {
/** Workflow is marked as clean (not dirty)
* @since 4.6 */
WORKFLOW_CLEAN,
/**
* The workflow has changed
*
* @since 5.10
*/
WORKFLOW_CHANGED,
/**
* Metadata of the currently open workflow (e.g. project or component) has changed
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9958,11 +9958,12 @@ void unsetDirty() {
/** {@inheritDoc} */
@Override
public void setDirty() {
boolean sendEvent = !isDirty();
boolean sendWorkflowDirtyEvent = !isDirty();
super.setDirty();
if (sendEvent) {
if (sendWorkflowDirtyEvent) {
notifyWorkflowListeners(new WorkflowEvent(WorkflowEvent.Type.WORKFLOW_DIRTY, getID(), null, null));
}
notifyWorkflowListeners(new WorkflowEvent(WorkflowEvent.Type.WORKFLOW_CHANGED, getID(), null, null));
Comment on lines 9965 to +9967
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WORKFLOW_CHANGED event is fired unconditionally on every setDirty() call, even when the workflow is already dirty. This could result in redundant event notifications for listeners. Consider firing this event only when sendWorkflowDirtyEvent is true, or document why unconditional firing is necessary for the browser sync functionality.

Suggested change
}
notifyWorkflowListeners(new WorkflowEvent(WorkflowEvent.Type.WORKFLOW_CHANGED, getID(), null, null));
notifyWorkflowListeners(new WorkflowEvent(WorkflowEvent.Type.WORKFLOW_CHANGED, getID(), null, null));
}

Copilot uses AI. Check for mistakes.
}

//////////////////////////////////////
Expand Down