Skip to content

Fix stale moved or deleted notifications from library element provider - #3246

Open
mx990 wants to merge 1 commit into
eclipse-4diac:3.4.xfrom
mx990:editor-file-move-fix
Open

mx990 wants to merge 1 commit into
eclipse-4diac:3.4.xfrom
mx990:editor-file-move-fix

Conversation

@mx990

@mx990 mx990 commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

The UI job used to dispatch updates for moved or deleted files could deliver stale notifications in case of separate resource changed deltas. This could happen when immediately undoing a failed refactoring before the UI job for the original resource change had a chance to run. The stale update would then cause the editor to change its input to a non-existent file or close unnecessarily.

This handles move and delete updates where the original file still exists as content changes and moves where neither source nor destination exist as deletions. Consecutive moves will close the editor instead of attempting to follow along multiple resource changes. Restored files will not trigger any additional dialogs.

@mx990 mx990 added this to the 3.4 milestone Nov 27, 2026
@mx990
mx990 requested a balanced review from Copilot November 27, 2026 02:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A queued move notification can be dropped if its destination is moved or deleted before the UI job runs, leaving the editor attached to a nonexistent file without a follow-up notification.

1 open issue
What changed in this PR

This PR aims to prevent stale file notifications from changing or closing connected editors when a move or deletion is undone before notification dispatch.

Changes:

  • Dispatch move notifications only when the original file is absent and the destination exists.
  • Dispatch deletion notifications only when the original file remains absent.
File Description
plugins/​org.eclipse.fordiac.ide.model.ui/​src/​org/​eclipse/​fordiac/​ide/​model/​ui/​editors/​FileLibraryElementProvider.java Adds file-existence checks before dispatching move and deletion notifications.

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Test Results (pull_request)

  155 files    155 suites   1m 53s ⏱️
6 692 tests 6 691 ✅ 1 💤 0 ❌
6 693 runs  6 692 ✅ 1 💤 0 ❌

Results for commit f47316a.

♻️ This comment has been updated with latest results.

The UI job used to dispatch updates for moved or deleted files could
deliver stale notifications in case of separate resource changed deltas.
This could happen when immediately undoing a failed refactoring before
the UI job for the original resource change had a chance to run. The
stale update would then cause the editor to change its input to a
non-existent file or close unnecessarily.

This handles move and delete updates where the original file still
exists as content changes and moves where neither source not destination
exist as deletions. Consecutive moves will close the editor instead of
attempting to follow along multiple resource changes. Restored files
will not trigger any additional dialogs.
@mx990
mx990 force-pushed the editor-file-move-fix branch from 5979722 to f47316a Compare November 27, 2026 18:30
@mx990 mx990 changed the title Check file was actually moved or deleted in library element provider Fix stale moved or deleted notifications from library element provider Nov 27, 2026
@mx990
mx990 requested a balanced review from Copilot November 27, 2026 18:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the change that checks current file state before handling delayed move or delete notifications.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

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.

2 participants