MM-20642 - Failed to install marketplace plugin on older mattermost servers (#13237)

Automatic Merge
Этот коммит содержится в:
Ali Farooq
2019-12-02 13:42:54 -05:00
коммит произвёл mattermod
родитель b45e11b28c
Коммит 4e5004ddd2
3 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@@ -915,6 +915,9 @@ func TestInstallMarketplacePlugin(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) {
serverVersion := req.URL.Query().Get("server_version")
require.NotEmpty(t, serverVersion)
require.Equal(t, model.CurrentVersion, serverVersion)
res.WriteHeader(http.StatusOK)
json, err := json.Marshal([]*model.MarketplacePlugin{samplePlugins[1]})
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)
}
filter := &model.MarketplacePluginFilter{Filter: request.Id}
filter := &model.MarketplacePluginFilter{Filter: request.Id, ServerVersion: model.CurrentVersion}
plugin, err := marketplaceClient.GetPlugin(filter, request.Version)
if err != nil {
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",
"translation": "Plugin not found."
"translation": "Could not find the requested marketplace plugin."
},
{
"id": "app.plugin.marshal.app_error",