[plugins] IJPL-183064 Plugins: infinite loading of advertiser suggestions breaks editor notifications

GitOrigin-RevId: 7da131ac3357e39622e9a931f2a89ffba6c620b0
This commit is contained in:
Yuriy Artamonov
2025-04-12 15:04:29 +00:00
committed by intellij-monorepo-bot
parent ee1b138d8c
commit a4813ffc18
@@ -144,6 +144,8 @@ class PluginAdvertiserExtensionsStateService : SettingsSavingComponent {
updateCache(extensionOrFileName, compatiblePlugins)
LOG.debug("Found compatible plugins for files '$extensionOrFileName': ${compatiblePlugins.joinToString { it.pluginIdString }}")
return@withContext true
}
}
@@ -162,10 +164,10 @@ class PluginAdvertiserExtensionsStateService : SettingsSavingComponent {
var refreshedCompatiblePlugins = false
for (h in fileHandlerDetectors) {
if (!force && cache.getIfPresent(h.id) != null) continue // already filled cache in this session
val implementationName = "${FILE_HANDLER_KIND}:${h.id}"
if (!force && cache.getIfPresent(implementationName) != null) continue // already filled cache in this session
// if network fails we will have empty results here and do not ask again for the same file
cache.put(implementationName, PluginAdvertisedByFileContent(h, emptySet()))
@@ -173,6 +175,8 @@ class PluginAdvertiserExtensionsStateService : SettingsSavingComponent {
val compatiblePlugins = requestCompatiblePlugins(implementationName, knownDependencies.get(implementationName))
cache.put(implementationName, PluginAdvertisedByFileContent(h, compatiblePlugins))
LOG.debug("Found compatible handlers '${h.id}': ${compatiblePlugins.joinToString { it.pluginIdString }}")
refreshedCompatiblePlugins = true
}
}
@@ -216,7 +220,7 @@ class PluginAdvertiserExtensionsStateService : SettingsSavingComponent {
if (!UnknownFeaturesCollector.getInstance(project).isIgnored(unknownFeature)) {
val fromCache = (cache.getIfPresent(implementationName) as? PluginAdvertisedByFileContent)?.plugins
if (fromCache == null) return null // no compatible plugins info yet, need round-trip to Marketplace
if (fromCache == null) return null // no compatible plugins info yet, need a round-trip to Marketplace
val compatibleOnlyPlugins = fromCache.map { it.pluginIdString }