diff --git a/deployment/terraform/create.go b/deployment/terraform/create.go index d9cc97b65..d3a65fdbd 100644 --- a/deployment/terraform/create.go +++ b/deployment/terraform/create.go @@ -380,6 +380,7 @@ func (t *Terraform) updateAppConfig(ip string, sshc *ssh.Client, jobServerEnable cfg.ServiceSettings.EnableLocalMode = model.NewBool(true) cfg.ServiceSettings.CollapsedThreads = model.NewString(model.CollapsedThreadsDefaultOn) cfg.ServiceSettings.EnableLinkPreviews = model.NewBool(true) + cfg.ServiceSettings.EnablePermalinkPreviews = model.NewBool(true) cfg.EmailSettings.SMTPServer = model.NewString(t.output.MetricsServer.PrivateIP) cfg.EmailSettings.SMTPPort = model.NewString("2500") diff --git a/loadtest/control/simulcontroller/actions.go b/loadtest/control/simulcontroller/actions.go index f03319158..c593ad49f 100644 --- a/loadtest/control/simulcontroller/actions.go +++ b/loadtest/control/simulcontroller/actions.go @@ -876,6 +876,25 @@ func createMessage(u user.User, channel *model.Channel, isReply bool) (string, e message = control.AddLink(message) } + // 10% of messages will contain a permalink + if rand.Float64() < 0.10 { + post, err := u.Store().RandomPostForChannel(channel.Id) + if err != nil && !errors.Is(err, memstore.ErrPostNotFound) { + return "", err + } + // We ignore in case a post is not found. + if err == nil { + siteURL := u.Store().ClientConfig()["SiteURL"] + team, err := u.Store().CurrentTeam() + if err != nil { + return "", err + } + pl := siteURL + "/" + team.Name + "/pl/" + post.Id + + message += " " + pl + " " + } + } + message += genMessage(isReply) return message, nil }