LOLINTERNETZ / vscodeoffline

Enables Visual Studio Code's extension gallery to be used in offline (air-gapped) environments. Or, run your own gallery!
https://hub.docker.com/u/lolinternet
MIT License
97 stars 31 forks source link

Unable to update to ms-vscode.cpptools version 1.12.4 from vscgallery and other extensions don't update to recent versions #44

Closed forky2 closed 1 year ago

forky2 commented 1 year ago

Sorry this issue is so specific; it's probably a general issue unrelated to this extension itself, but this is the only extension I've seen the problem with.

I'm running vscgallery using docker image 1.0.22, and I am behind an airgap. A recent vscsync has been performed to collect all extensions (including v 1.12.4 of the above extension). These files have been copied in and are present for the vscgallery. However, the version that vscode offers to install is 1.6.0.

I have no idea why 1.12.4 is being ignored. I'm using Developer Tools to view the queries and responses, and I can see that when I search for "cpptools" I get a json set of results that includes ms-vscode.cpptools and version "1.12.4". My version of vscode (1.72.2) is greater than the Microsoft.VisualStudio.Code.Engine value (^1.67.0). AFAIK it should be regognised and offered for installation, but for some reason it's being ignored and an older version retrieved instead.

Any ideas, please? I'm kind of losing my mind trying to figure out what's happening. The only thing special about 1.6.0 is that it is the last version I have downloaded that predates the switch to per platform releases with "targetPlatform".

LOLINTERNETZ commented 1 year ago

Ok - definitely a little strange but I'm surprised the API has remained relatively stable for so long.

Is the new 1.12.4 version being offered up at all for installation (in the JSON response from the gallery)? And vscode is selecting the wrong version, or the new version is not in the JSON response at all?

If it's not too tricky to do, is it possible to delete (or hide) the older artifact/extension versions? And see if the updated version gets called?

forky2 commented 1 year ago

Those were good debugging suggestions. If I moved 1.6.0 directory out then 1.12.4 would be the version that vscode would offer to install.

I did some playing around and vscode expects the order of the responses to the POST queries to be in reverse-chronological order. However, that is not what vscgallery is doing; it is returning them in reverse-alphanumberical order. Thus 1.6.0 will appear above 1.12.4.

I'm going to propose a simple fix (which I've confirmed works).

LOLINTERNETZ commented 1 year ago

Amazing and elegant fix!

Thanks for figuring out what was going on and for the PR. It's merged now and is in v1.0.23.

forky2 commented 1 year ago

No problem! Thanks for the great project. I'm please to support it and keep it working.