From 34e835ed3ceb5bc5587a958563cdb15e17626b63 Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Mon, 29 Mar 2021 07:45:10 +0200 Subject: [PATCH] Unlist messaging app on upgrade --- pkg/provision/migrations_202103_apps.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/provision/migrations_202103_apps.go b/pkg/provision/migrations_202103_apps.go index 964cf4ef0..95251b09b 100644 --- a/pkg/provision/migrations_202103_apps.go +++ b/pkg/provision/migrations_202103_apps.go @@ -16,9 +16,16 @@ func migrateApplications(ctx context.Context, s store.Storer) error { } return set.Walk(func(app *types.Application) (err error) { - // Disable messaging app but only if it was not updated after 21.3 release date + // Disable and unlist messaging app + // but only if it was not updated after 21.3 release date if app.Unify.Url == "/messaging" && (app.UpdatedAt == nil || app.UpdatedAt.Before(rd)) { + if app.Unify == nil { + app.Unify = &types.ApplicationUnify{} + } + + app.Unify.Listed = false app.Enabled = false + err = store.UpdateApplication(ctx, s, app) }