From 413c3e1fabcf26c0fb50f724e1e4a4c26330ed4c Mon Sep 17 00:00:00 2001 From: Kostya Ripak Date: Thu, 27 Aug 2026 12:40:47 +0300 Subject: [PATCH] IJPL-253782 remote development, plugin manager: Do not overwrite updates with local source In split mode updates are coming from CombinedPluginUpdateHandler which already have correct source set. (cherry picked from commit 1b1f23880e058073ae05468d36c14a52f84c2e1f) IJ-MR-220930 GitOrigin-RevId: 70c544cee932d2cfee5d7e3107b932d4f7fd40b7 --- .../plugins/newui/DefaultPluginUpdatesProvider.kt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/newui/DefaultPluginUpdatesProvider.kt b/platform/platform-impl/src/com/intellij/ide/plugins/newui/DefaultPluginUpdatesProvider.kt index 8aa9203d75ea..c00ffd677ccc 100644 --- a/platform/platform-impl/src/com/intellij/ide/plugins/newui/DefaultPluginUpdatesProvider.kt +++ b/platform/platform-impl/src/com/intellij/ide/plugins/newui/DefaultPluginUpdatesProvider.kt @@ -73,9 +73,9 @@ class DefaultPluginUpdatesProvider(private val coroutineScope: CoroutineScope) : updateMutex.withLock { runCatching { val model = (PluginUpdateHandler.getInstance().loadAndStorePluginUpdates(null)) - val pluginUpdates = PluginUpdatesEvent(model.pluginUpdates.markLocal(), - model.disabledPluginUpdates.markLocal(), - model.updatesFromCustomRepositories.markLocal()) + val pluginUpdates = PluginUpdatesEvent(model.pluginUpdates.markLocalIfUnset(), + model.disabledPluginUpdates.markLocalIfUnset(), + model.updatesFromCustomRepositories.markLocalIfUnset()) lastPluginUpdates = pluginUpdates emitUpdates(pluginUpdates) }.getOrHandleException { e -> LOG.warn("Failed to load plugin updates:", e) } @@ -116,5 +116,11 @@ class DefaultPluginUpdatesProvider(private val coroutineScope: CoroutineScope) : ) } - private fun List.markLocal(): List = onEach { it.source = PluginSource.LOCAL } + /** + * Sets the source of an update that the handler left unset. + * The combined handler of the split frontend already sets LOCAL, REMOTE, or BOTH. + */ + private fun List.markLocalIfUnset(): List = onEach { + if (it.source == null) it.source = PluginSource.LOCAL + } }