Respect version constraints when installing extensions (#10052)

This PR modifies the extension installation and update process to
respect version constraints (schema version and Wasm API version) to
ensure only compatible versions of extensions are able to be installed.

To achieve this there is a new `GET /extensions/updates` endpoint that
will return extension versions based on the provided constraints.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
This commit is contained in:
Marshall Bowers 2024-04-01 17:10:30 -04:00 committed by GitHub
parent 39cc3c0778
commit 83ce783856
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 304 additions and 78 deletions

View file

@ -587,12 +587,11 @@ impl ExtensionsPage {
.disabled(disabled)
.on_click(cx.listener({
let extension_id = extension.id.clone();
let version = extension.manifest.version.clone();
move |this, _, cx| {
this.telemetry
.report_app_event("extensions: install extension".to_string());
ExtensionStore::global(cx).update(cx, |store, cx| {
store.install_extension(extension_id.clone(), version.clone(), cx)
store.install_latest_extension(extension_id.clone(), cx)
});
}
})),