Support extensions marketplace context in the Web IDE

MR: feat: support extensions marketplace settings c... (!392 - merged)

Description

In order to support storing different extensions setting per user based on the extensions marketplace context as part of the Settings Sync feature, we will need to pass the extensions marketplace settings ID as part of the Web IDE configuration.

We currently have existing logic to clear the extensions data in the vscode-web-db IndexedDB table and Settings Sync backend store if the extensions marketplace enabled settings change. This needs to be modified to account for the extensions marketplace context.

In addition, we want to clear the lastSyncUserData records in the vscode-web-state-db-global IndexedDB table when the extensions marketplace context changes. This is so that the persisted extensions settings don't get overwritten due to the fact that Settings Sync is skipped when extensions marketplace is disabled. More info on that here.

Acceptance Criteria

  • If extensions marketplace settings hash is defined in the Web IDE config, Settings Sync URL includes it as a path parameter.
  • When the extensions marketplace context ID changes:
    • extensions.json and lastSyncUserData are cleared from IndexedDB.
    • Does not remove the persisted extensions settings.

Technical Requirements

  • Modify the Web IDE config to add an optional extensionsMarketplaceSettingsHash field. Maybe in this SettingsEnabled interface?
  • Update the Settings Sync URL such that extensionsMarketplaceSettingsHash is passed as a path parameter if it exists in the config. New URL: api/v4/vscode/settings_sync/:settings_context_hash.
  • Modify cleanWebIdeExtensions logic to account for extensions marketplace context. Note that for this case, we don't need to delete the persisted extensions settings.
    • Store the extensionsMarketplaceSettingsHash in local storage
    • Clear lastSyncUserData from IndexedDB.
  • Release Web IDE
Edited by Cindy Halim