MM-20642 - Failed to install marketplace plugin on older mattermost servers (#13237)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
mattermod
родитель
b45e11b28c
Коммит
4e5004ddd2
@@ -915,6 +915,9 @@ func TestInstallMarketplacePlugin(t *testing.T) {
|
|||||||
|
|
||||||
t.Run("verify, install and remove plugin", func(t *testing.T) {
|
t.Run("verify, install and remove plugin", func(t *testing.T) {
|
||||||
testServer := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
|
testServer := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
|
||||||
|
serverVersion := req.URL.Query().Get("server_version")
|
||||||
|
require.NotEmpty(t, serverVersion)
|
||||||
|
require.Equal(t, model.CurrentVersion, serverVersion)
|
||||||
res.WriteHeader(http.StatusOK)
|
res.WriteHeader(http.StatusOK)
|
||||||
json, err := json.Marshal([]*model.MarketplacePlugin{samplePlugins[1]})
|
json, err := json.Marshal([]*model.MarketplacePlugin{samplePlugins[1]})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|||||||
@@ -432,7 +432,7 @@ func (a *App) GetMarketplacePlugin(request *model.InstallMarketplacePluginReques
|
|||||||
return nil, model.NewAppError("GetMarketplacePlugin", "app.plugin.marketplace_client.app_error", nil, err.Error(), http.StatusInternalServerError)
|
return nil, model.NewAppError("GetMarketplacePlugin", "app.plugin.marketplace_client.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
||||||
filter := &model.MarketplacePluginFilter{Filter: request.Id}
|
filter := &model.MarketplacePluginFilter{Filter: request.Id, ServerVersion: model.CurrentVersion}
|
||||||
plugin, err := marketplaceClient.GetPlugin(filter, request.Version)
|
plugin, err := marketplaceClient.GetPlugin(filter, request.Version)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, model.NewAppError("GetMarketplacePlugin", "app.plugin.marketplace_plugins.not_found.app_error", nil, err.Error(), http.StatusInternalServerError)
|
return nil, model.NewAppError("GetMarketplacePlugin", "app.plugin.marketplace_plugins.not_found.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
|
|||||||
@@ -3588,7 +3588,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "app.plugin.marketplace_plugins.not_found.app_error",
|
"id": "app.plugin.marketplace_plugins.not_found.app_error",
|
||||||
"translation": "Plugin not found."
|
"translation": "Could not find the requested marketplace plugin."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "app.plugin.marshal.app_error",
|
"id": "app.plugin.marshal.app_error",
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user