Skip to content
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

Download latest compatible extensions prior to VS Code update #125417

Closed
rebornix opened this issue Jun 3, 2021 · 12 comments
Closed

Download latest compatible extensions prior to VS Code update #125417

rebornix opened this issue Jun 3, 2021 · 12 comments
Assignees
Labels
extensions Issues concerning extensions feature-request Request for new features or functionality install-update VS Code installation and upgrade system issues on-testplan papercut 🩸 A particularly annoying issue impacting someone on the team
Milestone

Comments

@rebornix
Copy link
Member

rebornix commented Jun 3, 2021

Issue Type: Feature Request

Extensions using latest API (or new APIs in coming Stable releases), they are now suffering from some "down time" as the upgrade of VS Code and extensions don't happen at the same time. Though we can't improve every indivual scenario, but we can improve this case:

  1. Extensions publish a new version targetting new VS Code version
  2. VS Code upgrades, window reloads
  3. The extension activation fails as the API is not compatible
  4. Check the extension page, there is a reload request for the extension
  5. Another window reload fixes the problem.

Often that users find the extension stop working, for example, they can't open Jupyter notebook anymore even though a compatible version of the Jupyter extension is already available.

Suggestion:

  • When there is a new version of VS Code
    • download the binaries
    • fetch all latest compatible extensions for the new binary, unzip them
  • Users restart VS Code to upgrade, the latest extensions are activated

VS Code version: Code - Insiders 1.57.0-insider (20df877, 2021-06-03T06:38:36.085Z)
OS version: Windows_NT x64 10.0.19041

@rebornix rebornix added the papercut 🩸 A particularly annoying issue impacting someone on the team label Jun 3, 2021
@joyceerhl
Copy link
Collaborator

The scenario I usually run into looks like this:

  1. Jupyter extension and VS Code Insiders publish update to new API overnight
  2. User already has VS Code open
  3. Jupyter extension update automatically downloads
  4. VS Code update is available. In my experience sometimes this gets automatically downloaded, and sometimes I have to use the Help menu to check for pending updates, at which time the download takes place. After the download happens (manually or automatically), sometimes I notice a notification to restart VS Code, other times not. Failure to restart VS Code at this point is the problem, as the new Jupyter extension build has already been loaded

Here are examples of times that this has happened to Jupyter extension users.

@rebornix
Copy link
Member Author

rebornix commented Jun 3, 2021

as the new Jupyter extension build has already been loaded

@joyceerhl should this already be addressed by #121749?

@DonJayamanne
Copy link
Contributor

tch all latest compatible extensions for the new binary, unzip them

Whoa, I was always under the impression this was already happening, sounds like VS Code looks for updates after it has been updated and loaded.

Yes please, this sounds like a very good feature.

@joyceerhl
Copy link
Collaborator

@rebornix thanks for the pointer to #121749, Jupyter extension should adopt this.

@sandy081
Copy link
Member

sandy081 commented Jun 4, 2021

@rebornix

fetch all latest compatible extensions for the new binary, unzip them

Does it cause the old version of VS Code to load newly unzipped extensions - for eg., if open a new window without restarting VS Code?

How about not enabling the extension if it is not compatible?

@sandy081 sandy081 added the under-discussion Issue is under discussion for relevance, priority, approach label Jun 4, 2021
@rebornix
Copy link
Member Author

rebornix commented Jun 4, 2021

Does it cause the old version of VS Code to load newly unzipped extensions - for eg., if open a new window without restarting VS Code?

Good point, we can't unzip them until VS Code restarts (instead of window reloads). If we have hooks for that, we can unzip when VS Code shuts down.

How about not enabling the extension if it is not compatible?

The problem with this approach is it's the same experience as enabling incompatible extensions, for notebooks or custom editors. When reloading a window which has notebooks open, the extensions need to be activated successfully otherwise users won't see the notebook editor loaded correctly. Also still users would have no idea what to do if the extensions are disabled.

@rebornix
Copy link
Member Author

rebornix commented Jun 4, 2021

if we have hooks for that, we can unzip when VS Code shuts down

To reduce the download time and prevent the extensions download/unzip slowing down the restart/reload

  • Download new VS Code and new compatible extensions which don't work in current VS Code
  • When users restart VS Code, on shutdown or launch, unzip the newly downloaded extensions.

@rebornix
Copy link
Member Author

rebornix commented Jun 7, 2021

Does it cause the old version of VS Code to load newly unzipped extensions - for eg., if open a new window without restarting VS Code?

Actually we can prevent this from happening, if VS Code always loads the compatible extension folder, other than finding the one with greatest version.

@TylerLeonhardt
Copy link
Member

I want to also call out that something like this is incredibly important for Language Packs which use the engine version to snap to the translations provided. We want to give the users a translated experience upon upgrading VS Code and we can't do that if we don't update the language pack until after upgrading VS Code.

@sandy081 sandy081 added extensions Issues concerning extensions feature-request Request for new features or functionality install-update VS Code installation and upgrade system issues and removed under-discussion Issue is under discussion for relevance, priority, approach labels Jun 8, 2021
@sandy081 sandy081 added this to the Backlog milestone Jun 8, 2021
@sandy081
Copy link
Member

sandy081 commented Jun 8, 2021

Actually we can prevent this from happening, if VS Code always loads the compatible extension folder, other than finding the one with greatest version.

Yeah that will be useful.

When there is a new version of VS Code
download the binaries
fetch all latest compatible extensions for the new binary, unzip them
Users restart VS Code to upgrade, the latest extensions are activated

CCing @joaomoreno for any insights on update hooks

@joaomoreno
Copy link
Member

joaomoreno commented Jun 8, 2021

@sandy081 The update service fires events: https://github.com/microsoft/vscode/blob/bae654ad1d8c0baaa67e1400a694e91893347fa4/src/vs/platform/update/common/update.ts/#L86

A bunch of update states have information about the upcoming update, including the product version that's about to be installed. Note that this can always be ahead, the same or even behind (when we roll back). Also note that users can also cancel updates midway, so that's another problem you're gonna have.

@rebornix
Copy link
Member Author

rebornix commented Jun 8, 2021

Also note that users can also cancel updates midway, so that's another problem you're gonna have

The cost of this is we download extensions which users might not need, which is bad but does not break the product.

@sandy081 sandy081 modified the milestones: Backlog, March 2024 Mar 5, 2024
sandy081 added a commit that referenced this issue Mar 6, 2024
…06924)

#125417 update extensions compatible with newly available VS Code version
yiliang114 pushed a commit to yiliang114/vscode that referenced this issue Mar 6, 2024
sandy081 added a commit that referenced this issue Mar 7, 2024
…6997)

* #125417 restart extension host for updating extensions instead of reload

* 💄

* team feedback

* fix enum const
@microsoft microsoft locked and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions Issues concerning extensions feature-request Request for new features or functionality install-update VS Code installation and upgrade system issues on-testplan papercut 🩸 A particularly annoying issue impacting someone on the team
Projects
None yet
Development

No branches or pull requests

6 participants