Skip to content

Fix write-unsafe VFS refresh when loading templates#2593

Open
morfidon wants to merge 1 commit intominecraft-dev:devfrom
morfidon:dev
Open

Fix write-unsafe VFS refresh when loading templates#2593
morfidon wants to merge 1 commit intominecraft-dev:devfrom
morfidon:dev

Conversation

@morfidon
Copy link

@morfidon morfidon commented Mar 14, 2026

closes #2592
Run VFS refresh via Application.invokeAndWait(..., modalityState) instead of calling RefreshQueue.refresh() inside a writeAction.

This preserves the current wizard/dialog modality state and prevents "Write-unsafe context! Model changes are allowed from write-safe contexts only"errors when loading templates on newer IntelliJ Platform versions.

Replace RefreshQueue.refresh() wrapped in writeAction with VirtualFile.refresh() invoked via Application.invokeAndWait(..., modalityState).
This preserves the current wizard/dialog modality state and avoids Write-unsafe context! failures on newer IntelliJ Platform builds.
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.

Write-unsafe context!

1 participant