-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vsx-registry: Skip extension resolution if already installed #10624
Conversation
cc @luettmaSICKAG this should fix the issue you were experiencing. Do you mind testing this PR to confirm that the resolution works as expected? |
Hmm sadly not completely. I couldn't test it with your plugins and the public OpenVSX marketplace due to our company proxy and no support in Theia yet. The issue we have is a little bit different to the test you described in the PR. When installing the plugins manually (from vsix) everything seems to work correctly (no downgrades). Logs First start and installing the |
@luettmaSICKAG I was able to reproduce the dependency downgrade issue with the exact configuration that I use here as my testing steps on Basically the extension dependency situation is as follows:
When installing my custom version 2.42.0 of The My PR fixes this exact behavior by identifying whether an extension dependency already exists in the list of deployed plugins and stops the extension resolution if the fetched version is not a version upgrade. I hope that clears things up. Am I still wrong in the assumption that it mimics your setup? |
Oh right sorry, I missed that. No the setup is correct. Do you mind trying to test it with |
@luettmaSICKAG No worries :) I just retested the fix with unpacking the vsix files first and adding them to the list of built-in extensions. It still works correctly. I added the additional testing step to the original PR comment 👍 |
0095840
to
cdaee64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have confirmed the bug on master
and that this change addresses the issue. I have some misgivings about what happens in cases when this code does not apply and we do download a new version of the plugin, but this code reduces the frequency of that event, so it's at least a step in the right direction. 👍
I just tested it again on my private device, with your setup and the public OVSX registry. Not quite sure if the problem is on my side, so I just recorded it :s What I did
|
@luettmaSICKAG Thanks for looking into this again. You're right, when restarting the app, the plugin resolving mechanism starts a second time, this time downloading the outdated version, since the plugins aren't deployed yet. I'll look into a solution for this 👍 |
@colin-grant-work Do you mind checking out step 6 of the testing steps? My newest changes fixes a restart-related downgrade issue. Previously, |
this.logMeasurement('Deploy plugin entry', startDeployTime); | ||
} | ||
|
||
protected async deployMultipleEntries(pluginEntries: ReadonlyArray<string>, type: PluginType = PluginType.System): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this (and resolvePlugins
) the change that requires the introduction of the UnresolvedPluginEntry
interface? It looks like previously we could only have a list of plugins with uniform plugin types, and now we want to have a list of plugin with mixed types. Otherwise, it looks like the same information was being passed around everywhere, just not necessarily in the same struct package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, we need the mixed type since we need to resolve all user and builtin extensions in the first step. Though it's mostly resolvePlugins
, since the main culprit of this issue is introduced here:
theia/packages/plugin-ext/src/main/node/plugin-deployer-impl.ts
Lines 121 to 124 in c56aa23
const [userPlugins, systemPlugins] = await Promise.all([ | |
this.resolvePlugins(context.userEntries, PluginType.User), | |
this.resolvePlugins(context.systemEntries, PluginType.System) | |
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm that the new changes also prevent the inappropriate loading of dependencies during startup - the existing builtin plugins are used to satisfy the dependencies of user plugins.
…-theia#10624) * Existing extensions are skipped on extension download * All extensions are considered for dependencies during startup Signed-off-by: Federico Bozzini <[email protected]>
What it does
Closes #10560 by comparing the versions of already installed extensions with the to-be-resolved extension version. When the extension already exists and its version is greater or equal to the one that should be installed, its download is skipped.
How to test
hbenl.test-adapter-converter
andhbenl.vscode-test-explorer
(in this exact order) extension from here. Thehbenl.vscode-test-explorer
version has been increased to2.42.0
to recreate the original issue.hbenl.vscode-mocha-test-adapter
) and install it. It requires thehbenl.version-test-explorer
as an extension dependency.[hbenl.vscode-test-explorer]: is already installed with the same or newer version '2.42.0'
should appear.<user>/.theia
directory..vsix
file, unpack the extensions into yourplugins
folder. Additionally perform the test by adding the.vsix
directly to theplugins
folder without unpacking them.Review checklist
Reminder for reviewers