Skip to content

Wrap Editor changes in write actions#157

Merged
Pushpavel merged 1 commit intoPushpavel:mainfrom
jthuermann:main
Feb 2, 2026
Merged

Wrap Editor changes in write actions#157
Pushpavel merged 1 commit intoPushpavel:mainfrom
jthuermann:main

Conversation

@jthuermann
Copy link
Contributor

Fixes #143

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...m/github/pushpavel/autocp/tool/ui/TestcasePanel.kt 0.00% 7 Missing ⚠️
.../github/pushpavel/autocp/tool/ui/GeneratorPanel.kt 0.00% 4 Missing ⚠️
...hub/pushpavel/autocp/tool/ui/JudgeSettingsPanel.kt 0.00% 3 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Files with missing lines Coverage Δ
...hub/pushpavel/autocp/tool/ui/JudgeSettingsPanel.kt 0.00% <0.00%> (ø)
.../github/pushpavel/autocp/tool/ui/GeneratorPanel.kt 0.00% <0.00%> (ø)
...m/github/pushpavel/autocp/tool/ui/TestcasePanel.kt 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@znzryb
Copy link
Contributor

znzryb commented Jan 27, 2026

You solve the error like this? That's great!

image
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action only (see Application.runReadAction()); If you access or modify model on EDT consider wrapping your code in WriteIntentReadAction  or ReadAction; see https://jb.gg/ij-platform-threading for details
Current thread: Thread[#54,AWT-EventQueue-0,6,main] 456883336 (EventQueue.isDispatchThread()=true)
SystemEventQueueThread: (same)
	at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:257)
	at com.intellij.util.concurrency.ThreadingAssertions.softAssertReadAccess(ThreadingAssertions.java:173)
	at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:1014)
	at com.intellij.openapi.editor.impl.CaretImpl.hasSelection(CaretImpl.java:1019)
	at com.intellij.openapi.editor.impl.CaretImpl.getSelectionStartLogicalPosition(CaretImpl.java:950)
	at com.intellij.openapi.editor.impl.CaretModelImpl.getCaretsAndSelections(CaretModelImpl.java:520)
	at com.intellij.openapi.fileEditor.impl.text.TextEditorProvider.getStateImpl(TextEditorProvider.kt:187)
	at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorProvider.getStateImpl(PsiAwareTextEditorProvider.kt:175)
	at com.intellij.openapi.fileEditor.impl.text.AsyncEditorLoader.getEditorState(AsyncEditorLoader.kt:191)
	at com.intellij.openapi.fileEditor.impl.text.TextEditorImpl.getState(TextEditorImpl.kt:155)
	at com.intellij.openapi.command.impl.UndoManagerImpl.getCurrentState(UndoManagerImpl.java:361)
	at com.intellij.openapi.command.impl.UndoManagerImpl.commandStarted(UndoManagerImpl.java:316)
	at com.intellij.openapi.command.impl.UndoManagerImpl.onCommandStarted(UndoManagerImpl.java:267)
	at com.intellij.openapi.command.impl.UndoManagerImpl$MyCommandListener.undoTransparentActionStarted(UndoManagerImpl.java:1021)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:765)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:712)
	at com.intellij.util.messages.impl.MessageBusImplKt.executeOrAddToQueue(MessageBusImpl.kt:533)
	at com.intellij.util.messages.impl.ToDirectChildrenMessagePublisher.publish$intellij_platform_core(CompositeMessageBus.kt:281)
	at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:481)
	at jdk.proxy2/jdk.proxy2.$Proxy122.undoTransparentActionStarted(Unknown Source)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.withUndoTransparentAction(CoreCommandProcessor.java:405)
	at com.intellij.openapi.application.ActionsKt.runUndoTransparentWriteAction(actions.kt:16)
	at com.github.pushpavel.autocp.tool.ui.TestcasePanel.contentChanged(TestcasePanel.kt:40)
	at com.github.pushpavel.autocp.tool.ui.TestcasePanel.contentChanged(TestcasePanel.kt:18)
	at com.github.pushpavel.autocp.common.ui.swing.editableList.EditableListView.intervalAdded(EditableListView.kt:68)
	at java.desktop/javax.swing.AbstractListModel.fireIntervalAdded(AbstractListModel.java:157)
	at com.intellij.ui.CollectionListModel.addAll(CollectionListModel.java:65)
	at com.intellij.ui.CollectionListModel.add(CollectionListModel.java:58)
	at com.intellij.ui.CollectionListModel.replaceAll(CollectionListModel.java:119)
	at com.github.pushpavel.autocp.tool.ui.TestcaseListPanel$2$1.emit(TestcaseListPanel.kt:99)
	at com.github.pushpavel.autocp.tool.ui.TestcaseListPanel$2$1.emit(TestcaseListPanel.kt:95)
	at kotlinx.coroutines.flow.FlowKt__TransformKt$filterNotNull$$inlined$unsafeTransform$1$2.emit(Emitters.kt:50)
	at com.github.pushpavel.autocp.database.SolutionFiles$listenFlow$$inlined$map$1$2.emit(Emitters.kt:50)
	at kotlinx.coroutines.flow.StateFlowImpl.collect(StateFlow.kt:401)
	at com.github.pushpavel.autocp.database.SolutionFiles$listenFlow$$inlined$map$1.collect(SafeCollector.common.kt:109)
	at kotlinx.coroutines.flow.FlowKt__TransformKt$filterNotNull$$inlined$unsafeTransform$1.collect(SafeCollector.common.kt:109)
	at com.github.pushpavel.autocp.tool.ui.TestcaseListPanel$2.invokeSuspend(TestcaseListPanel.kt:95)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:585)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:482)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10$lambda$9(IdeEventQueue.kt:307)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:864)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10(IdeEventQueue.kt:306)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:958)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:109)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:958)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12(IdeEventQueue.kt:301)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:341)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

@jthuermann
Copy link
Contributor Author

Are you sure you are using the updated version?

	at com.github.pushpavel.autocp.tool.ui.TestcasePanel.contentChanged(TestcasePanel.kt:40)

There is no code in line 40 of TestcasePanel.kt after the change I commited.

@znzryb
Copy link
Contributor

znzryb commented Jan 29, 2026

Are you sure you are using the updated version?

	at com.github.pushpavel.autocp.tool.ui.TestcasePanel.contentChanged(TestcasePanel.kt:40)

There is no code in line 40 of TestcasePanel.kt after the change I commited.

no,I just describe the issue again.

I am not using the newest version.

@jthuermann
Copy link
Contributor Author

@Pushpavel ?

@Pushpavel
Copy link
Owner

Hi @jthuermann, I'll review this and recent PRs after resolving the current CI issue in the verify_plugin step.

Copy link
Owner

@Pushpavel Pushpavel left a comment

Choose a reason for hiding this comment

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

Hi @jthuermann, I am merging this now, thanks for the fix.

@Pushpavel Pushpavel merged commit a39a2fb into Pushpavel:main Feb 2, 2026
3 of 4 checks passed
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.

Extension not working

4 participants