RocketChat / RocketChat/Rocket.Chat

Link preview in formatted code appears if message edited

Open
#12,088 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area: ui/ux feat: message
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

As resolved by #5013, links posted inside formatted code blocks do not have link previews. If this message is edited however (regardless of if any change is actually made to the message or the code block or the link), a link preview is then generated, despite it still not being appropriate.

Steps to reproduce:
  1. Post a link in chat inside a formatted code block, eg `https://github.com/`
  2. Wait long enough to convince yourself a link preview is not going to appear
  3. Press up to edit the message, and then press enter to "edit" the message (despite making no changes)
  4. A link preview will appear
Expected behavior:

No link preview to appear if the edited message does not remove the link from the code block.

Actual behavior:

image

Server Setup Information:
  • Version of Rocket.Chat Server: 0.69.2
  • Operating System: Ubuntu 18.04.1 LTS
  • Deployment Method: snap
  • Number of Running Instances: 1
  • NodeJS Version: v8.11.3
Additional context

This seems to be a pretty straightforward bug / oversight in the initial resolving of the bug, so I haven't supplied logs. If I get hung, drawn, and quartered for this oversight I'll look to change that.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing issue #5013 and reproducing the edit flow with a link inside a formatted code block. Trace how edited messages are processed for link previews; done means saving an unchanged or still-code-formatted message does not generate a preview, while removing the link from the code block preserves the expected preview behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.