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
This commit is contained in:
Kostya Ripak
2026-08-31 12:19:56 +00:00
committed by intellij-monorepo-bot
parent a579249db8
commit 413c3e1fab
@@ -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<PluginDto>.markLocal(): List<PluginDto> = 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<PluginDto>.markLocalIfUnset(): List<PluginDto> = onEach {
if (it.source == null) it.source = PluginSource.LOCAL
}
}