A bug was reported in Discourse’s onebox engine where links to other Discourse instances were displaying incorrect or incomplete previews. Specifically, oneboxes were showing the original post’s text and image instead of the linked reply’s content, and some links (like post #254 in a topic) failed to render entirely. tophee provided examples and screenshots demonstrating the regression, noting that the issue appeared after recent upgrades. sam initially couldn’t reproduce the issue on try.discourse.org, but tophee confirmed it there as well. The root cause was traced to OpenGraph data being pulled from canonical URLs (which point to paginated topic pages, not the specific post), leading to mismatched content. techAPJ confirmed the bug and explained the intended behavior: for topic replies, oneboxes should show the post’s image if present, otherwise the user’s avatar. A fix was implemented to ignore canonical links for Discourse instances techAPJ, and later optimized techAPJ. codinghorror and sam raised concerns about the fix’s fragility, suggesting instead a custom OpenGraph tag to opt out of canonical URL handling. tophee also suggested ignoring very small images (like icons) as featured images, which techAPJ acknowledged as non-trivial to implement. The fix is now deployed and verified on try.discourse.orgtechAPJ.
Never mind the different colour scheme. It’s the text that is different. In the older version, the text of the post being referred to is shown, now it’s the text of the OP (although I also wonder why the user avatar is missing in both cases, but that would be an older bug).
To be more precise: the old image is from my forum which is currently still on v1.9.0.beta4 +61, the new one is from feverbee (as of today) but I have also tried it on another freshly installed instance.
Next one is https://meta.discourse.org/t/change-to-dd-mmm-mmm-yy-for-post-dates/13625/35?u=tophee which used to render like this:
Like in the first example, the text is now the OP’s text but - strangely, now also the image is a different one (first image in post instead of user avatar).
Finally, this URL https://meta.discourse.org/t/discourse-narrative-bot-beta-feedback/58621/254?u=tophee used to render like this:
But just to be clear: what exactly is the expected behaviour when it comes to the images in the onebox? When should I expect the user avatar and when the first image in the post? (Personally, I think I’d always like to see the user avatar…)
Now when you will see og:{xyz} data for the canonical link above you will understand why the text and image is different from that of linked post.
That said, I agree that the text and image shown in onebox should be of the linked post (instead of the page specific post as seen in above example). I am working on a fix for it right now.
I didn’t even know that discourse still does pagination in the background, but as I think about it, I see that, unless you want to load each post individually, pagination is needed.
The pagination shown here is only for non-Javascript user-agents (like web crawlers). The javascript interface works differently, which is how/why posts can update live on screen.
Hm, as I paste this, I realize that the actual image file is not as tiny as it seems when it’s shown like this: , but nonetheless, do you see what I mean?
I am not a huge fan of this, what I would recommend is adding some sort of custom open graph tag that tells us not to follow canonical. That way any site owner can opt for this behavior not only Discourse instances. Hitting the URL with a regex is fragile and will eventually break, I can guarantee that 100%