Post previews in Telegram

AI-generated summary

Users are reporting an issue where Telegram previews for Discourse post links display incorrect or outdated content, despite the actual post link showing the correct excerpt in other tools like Open Graph testers or on different Discourse instances pmusaraj. MarcP suspects the problem may lie in how Telegram interprets the canonical URL, which currently points to a page-level URL (e.g., ?page=3) rather than the specific post anchor (e.g., #post_123). This behavior is not observed in Discord, suggesting Telegram may handle canonical tags differently. MarcP references a 2022 post suggesting that canonical links should include the post anchor to ensure correct preview targeting. The issue appears to stem from how Discourse generates canonical URLs for individual posts, potentially causing Telegram to fetch metadata from the wrong page context. Adding random query parameters (e.g., ?v=3333) forces Telegram to re-fetch metadata, confirming it’s not a caching issue on Telegram’s end, but rather a mismatch in URL targeting. Further investigation is needed to determine if this is a Telegram-specific parsing quirk or a Discourse-side canonical URL generation issue.

I noticed the previews in Telegram for post-links do not get the actual post preview.

Actual post link:

Some related SO:

For example, I can randomly /?v=3333 to my link, and can see that Telegram fetches new metadata for the URL, but in case of a specific post, the same is shown, makes me wonder if the issue is on Discourse side?

2 Likes

I’m not sure this is Discourse-specific, I tested the URL above in a) a different Discourse instance and b) an Open Graph tester like opengraph.xyz, and both show the correct excerpt.

2 Likes

Perhaps Telegram is doing something different.. the issue is not happening in Discord as well.

1 Like

This is what Telegram is looking at:

<link rel="canonical" href="https://meta.discourse.org/t/preparing-for-discourses-upgrade-to-ember-5/287211?page=3" />

Which links to: Preparing for Discourse's upgrade to Ember 5 - #48 by david

This is matching with the content Telegram is fetching as seen in my screenshots :thinking:

EDIT - this post from 2022 seems related.

2 Likes