Skip to content

Commit 81eae87

Browse files
jreznotintellij-monorepo-bot
authored andcommitted
[plugins] IJPL-217751 Incompatible plugins reported as installed and update checked on import settings
(cherry picked from commit 558825c720599440a8980f6a681c2cc724f822d7) IJ-CR-182042 GitOrigin-RevId: 7dbcff0ad6c31ef998738d465d28ef3d3be5c608
1 parent a7165df commit 81eae87

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

platform/platform-impl/src/com/intellij/ide/plugins/marketplace/MarketplaceRequests.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ class MarketplaceRequests(private val coroutineScope: CoroutineScope) : PluginIn
156156
throwExceptions: Boolean = false,
157157
updateCheck: Boolean = false
158158
): List<IdeCompatibleUpdate> {
159+
LOG.info("Looking for the last compatible plugin updates for:\n$allIds\n" +
160+
"Is update check: $updateCheck")
161+
159162
val chunks = mutableListOf<MutableList<PluginId>>()
160163
chunks.add(ArrayList(100))
161164

@@ -188,8 +191,9 @@ class MarketplaceRequests(private val coroutineScope: CoroutineScope) : PluginIn
188191
allIds: Set<PluginId>,
189192
buildNumber: BuildNumber? = null,
190193
throwExceptions: Boolean = false,
194+
updateCheck: Boolean = false,
191195
): List<IdeCompatibleUpdate> {
192-
return loadLastCompatiblePluginUpdate(allIds, buildNumber, throwExceptions, updateCheck = true)
196+
return loadLastCompatiblePluginUpdate(allIds, buildNumber, throwExceptions, updateCheck)
193197
}
194198

195199
@RequiresBackgroundThread

platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateChecker.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,9 @@ object UpdateChecker {
276276
for (host in RepositoryHelper.getPluginHosts()) {
277277
try {
278278
if (host == null && ApplicationInfoEx.getInstanceEx().usesJetBrainsPluginRepository()) {
279-
findUpdatesInJetBrainsRepository(updateable, toUpdate, toUpdateDisabled, buildNumber, state, indicator)
279+
// consider it as updateCheck only if we collected plugins here, and they are not passed from outside
280+
findUpdatesInJetBrainsRepository(updateable, toUpdate, toUpdateDisabled, buildNumber, state, indicator,
281+
updateCheck = updateablePluginsMap == null)
280282
}
281283
else {
282284
RepositoryHelper.loadPluginModels(host, buildNumber, indicator).forEach { model ->
@@ -374,10 +376,11 @@ object UpdateChecker {
374376
buildNumber: BuildNumber?,
375377
state: InstalledPluginsState,
376378
indicator: ProgressIndicator?,
379+
updateCheck: Boolean = false,
377380
) {
378381
val marketplacePluginIds = MarketplaceRequests.getInstance().getMarketplacePlugins(indicator)
379382
val idsToUpdate = updateable.keys.filter { it in marketplacePluginIds }.toSet()
380-
val updates = MarketplaceRequests.checkLastCompatiblePluginUpdate(idsToUpdate, buildNumber)
383+
val updates = MarketplaceRequests.checkLastCompatiblePluginUpdate(idsToUpdate, buildNumber, false, updateCheck)
381384
for ((id, descriptor) in updateable) {
382385
val lastUpdate = updates.find { it.pluginId == id.idString }
383386
if (lastUpdate != null &&

0 commit comments

Comments
 (0)