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

Link preview duplicate url filter considers anchors as unique element #17494

Closed
eras opened this issue May 28, 2021 · 0 comments · Fixed by matrix-org/matrix-js-sdk#1721 or matrix-org/matrix-react-sdk#6135
Assignees
Labels
A-URL-Previews S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect

Comments

@eras
Copy link

eras commented May 28, 2021

Copied from matrix-org/synapse#10088, but Element is the correct component for this issue.

Description

When receiving an URL in a room, a link preview is generated. If the same URL is seen twice, only one preview is generated. However, if the second link is the same but with an #anchor, the link preview is generated twice for the same content as, I assume, the homeserver will not consider the anchor at all for the actual preview generation process.

In client this is perhaps a bit tricky case because the homeserver could consider the anchor e.g. by running javascript or extracting some other part from the document for the preview, but as it is, it doesn't. To robustly handle this the client could send a request for both, but remove duplicate responses.

Steps to reproduce

  • Using Element Web, send a URL that produces a link preview twice to a room, but add #anchor to the end of the second URL, e.g. https://github.com/matrix-org/synapse/issues/10088 and https://github.com/matrix-org/synapse/issues/10088#foo
  • Witness two link preview appearing for the same content

Expected behaviour: only one link preview is generated.

Version information

  • Homeserver: matrix.org
  • Riot version: 1.7.28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-URL-Previews S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect
Projects
None yet
3 participants