Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MM-28980] Inconsistent behaviour in channel mentions in message attachments #15740

Closed
larkox opened this issue Oct 2, 2020 · 1 comment
Closed
Assignees
Labels
Area/Integrations A mattermost integration (plugin, integration, etc) Difficulty/2:Medium Medium ticket Hacktoberfest Help Wanted Community help wanted PR Exists Tech/React Native Mobile app Tech/ReactJS Web app

Comments

@larkox
Copy link
Contributor

larkox commented Oct 2, 2020

Summary

This ticket was originally filed on Jira: https://mattermost.atlassian.net/browse/MM-28980
When creating a channel mention link with fmt.Sprintf("~%s", channel.Name) in a message attachment, the behaviour is both inconsistent and buggy:

  • If the link is contained in the Title field, it does not render as a link on mobile, but it works on webapp.
  • If the link is contained in the Pretext field, the link works on both, but does force a page refresh on webapp (this is not expected).
  • If the link is contained in the Text field, it works on mobile, but it ends in a Not Found page on webapp.

Steps to reproduce

  1. Build a post such as
post := &model.Post{
	Message: message,
	Props: map[string]interface{}{
		"attachments": []*model.SlackAttachment{
			{
				Title: fmt.Sprintf("~%s", channel.Name),
				Text:    fmt.Sprintf("~%s", channel.Name),
				Pretext: fmt.Sprintf("~%s", channel.Name),
			},
		},
	},
}
  1. Send the post to a user.
  2. Read the post from the webapp and test all three links.
  3. Read the post from the mobile app and test all three links.

Expected behavior

The link should in all cases redirect to the channel without a page refresh nor opening a different tab.

Possible fixes

For the mobile problem, probably the text is just not parsed through the Markdown parser.
For webapp, there might be problems in the markdown parser, so it mark the links properly as internal links.

@jufab
Copy link

jufab commented Oct 5, 2020

FYI, my PR is only for the webapp issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Integrations A mattermost integration (plugin, integration, etc) Difficulty/2:Medium Medium ticket Hacktoberfest Help Wanted Community help wanted PR Exists Tech/React Native Mobile app Tech/ReactJS Web app
Projects
None yet
Development

No branches or pull requests

3 participants