coder / code-marketplace

Open source extension marketplace for VS Code.
GNU Affero General Public License v3.0
222 stars 23 forks source link

Returning latest version should return both latest pre-release and stable release #30

Closed code-asher closed 11 months ago

code-asher commented 11 months ago

Right now it only returns the pre-release (since that version is greater), so if you add a pre-release VS Code will no longer be able to install the standard/stable release of the extension. For discovery, the error you get is:

Can't install release version of '<extension id>' extension because it has no release version.

Workarounds are to remove the pre-release from the marketplace or tell VS Code to install the pre-release.

Fix is similar to the one for multi-platform support where we return the latest version for every platform. So now we would return the latest version for every platform and pre-release/release combination, then VS Code can decide which it wants.

It would make sense to double-check that this is how the VS Code marketplace API behaves, in case pre-releases are actually handled in a different way entirely. For example, maybe they are only returned if specifically requested and the fix is to actually ignore them unless the appropriate flag exists.

code-asher commented 11 months ago

I found a bug where we are not sending back the flags in the right format (they need to be converted from space-separated like they are in the manifest to comma-separated) but it does not seem related to this issue.

When I add both pre-release and release versions of an extension code-server seems to always install the release version even if I tell it to install the pre-release. So it seems to be at least partially working as intended. But I am not seeing any significant differences in the queries between VS Code and code-server + code-marketplace, and I see similar problems in VS Code so I think it is a VS Code bug.

As far as installing the release when the latest is a pre-release though, it seems to work.