Uninstall perviously installed Extensions when Extension Marketplace is disabled
MRs:
- Uninstall extensions if Extensions Marketplace ... (gitlab-web-ide!314 - merged)
- Show alert on web IDE start error (!154178 - merged)
Description
When the Extensions Marketplace is disabled for a user, we want to remove any marketplace extensions that were previously installed for that user.
- UX has indicated that this is consistent with user's goals if they disable the marketplace.
- This promotes security because we want to only have the
crossOriginExtensionHost
whenever the marketplace is enabled. Currently, if marketplace extensions stick around, we could end up running them in the same origin which would be problematic.
Acceptance Criteria
- When Web IDE loads, detect if the Extension Marketplace has been disabled since last time.
- If so, detect if some installed extensions exist in the user's IndexedDb local storage.
- Remove the marketplace extensions from IndexedDb local storage.
- Once this "Extension Marketplace" cleanup is finished then we can finish loading the Web IDE (see relevant LOC).
I'm thinking we only want to do this web_ide_extension_marketplace_enabled
flag in local storage or something on every visit to the Web IDE.
Extra: Maybe we want to update the loading text to say something like "Cleaning up installed extensions from marketplace..." or something like that?
Implementation plan
These changes should be based on Add Extensions Marketplace in Web IDE (!151352 - merged) so we might need to point to that branch until that MR is merged to master
.
- Leave an artifact on the client (probably local storage value
web_ide_extension_marketplace_enabled
) on every Web IDE visit, to determine if the extension marketplace was enabled last visit. - Add a
cleanMarketplaceExtensions()
function that clears out the relevantIndexedDb
data if the extension marketplace is being disabled.
Investigation
-
Where are extensions saved in the client? It looks like VSCode saves this in the IndexedDb database
vscode-web-db
in thevscode-userdata-store
under the key/User/extensions.json
. -
Will the settings sync try to reinstall the extensions automatically? I'm not sure... We'll have to test out this scenario
👀