Skip to content

Fix stale Git diff updates after mode changes and close - #9750

Open
emilianbold wants to merge 2 commits into
apache:masterfrom
emilianbold:fix-git-diff-lifecycle-races
Open

emilianbold wants to merge 2 commits into
apache:masterfrom
emilianbold:fix-git-diff-lifecycle-races

Conversation

@emilianbold

@emilianbold emilianbold commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Fixes stale Git Diff updates when a refresh result is published after the comparison mode changes or the window closes. Refresh work now carries a generation that is checked at the EDT publication boundary, close is terminal, and the diff-preparation worker is cancelled directly instead of only cancelling its RequestProcessor task.

Adds three latch-gated regressions covering obsolete-mode publication, publication after close, and in-flight preparation after close.

Verified with the full ide/git test-unit suite.

Assisted-by: DeepSeek V4.1 Flash
Assisted-by: OpenAI GPT-6.1 Sol

Invalidate obsolete refresh generations at EDT publication, cancel the preparation worker as well as its task wrapper, and prevent late views and listeners from being installed after close.

Add latch-gated controller regressions for mode changes, queued refresh publication after close, and in-flight diff preparation cancellation. Verified the three regressions plus existing test193781 against the compiled controller using NetBeans 31 dependency jars on JDK 21.

Assisted-by: DeepSeek V4.1 Flash
Assisted-by: OpenAI GPT-6.1 Sol
Capture the generation at the two preparation call sites and pass it into DiffPrepareTask instead of reading outer controller state in its constructor. Leave the reusable refresh and change workers unchanged.

Assisted-by: DeepSeek V4.1 Flash
Assisted-by: OpenAI GPT-6.1 Sol
@emilianbold emilianbold added the git [ci] enable versioning job label Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

git [ci] enable versioning job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant