Twitter/X links not unfurling correctly

AI-generated summary

A user, WolfpackFan, reports that Twitter/X links are not unfurling correctly on their self-hosted Discourse instance (version 3.6.0.beta1-dev), despite working on discourse.org. After troubleshooting, Moin clarifies that the issue stems from using the free tier of the Twitter Developer API, which does not support rich embeds—only Basic or higher plans do. WolfpackFan acknowledges the oversight and appreciates the help. tobiaseigen notes the term “unfurling” is commonly used and suggests improving the UI to better inform users when oneboxing fails, such as by displaying a simple link or an error message instead of a blank onebox. They also point out that the user’s example may have failed due to missing a line break before the URL, which is required for proper oneboxing.

When I post a direct twitter/x link in my forum it is not correctly unfurling. When I post the exact same link here on the discourse forum it is working.

My installed version: 3.6.0.beta1-dev (7c34595144)

Correctly Unfurled Example on discourse.org forums
https://x.com/ryanhallyall/status/1961057800693453214

Screenshot of my site incorrectly unfurled

Have you followed the steps in Configuring X login and rich embeds for Discourse?

I have NOT. Thank you for pointing me in the right direction!

I followed the directions to create a twitter consumer ID and secret (from the developers.x.com portal) using the “free” tier.

When I use these generated values and add them in the discourse settings as shown below I am still getting the same incorrectly unfurled twitter post as described in my original post.

Note that my discourse instance is a self-hosted on an AWS EC2 instance.

I think that’s the problem

But I agree the default experience could be improved so you don’t end up with a blank onebox when twitter settings not configured

Oh my gosh.. egg on my face. I failed to read the first paragraph of the documentation with the giant warning sign! How kind of you not to scold me!

I appreciate the prompt helpfulness provided here in the forum.

Yes, perhaps it should default to just the link if it isn’t configured.

I am loving the use of the term “unfurling”. We refer to oneboxing here for that functionality. I’ve added the onebox tag and also alerted the staff experience team to look into how the UI might be improved to make it easier to understan what’s going on in a case like this.

I believe there are other cases when the onebox displays an error message in the composer if it won’t be able to create a proper onebox. Maybe that could be a solution here as well. Or as you say just display it as a simple link if it’s not going to onebox correctly.

Looks like in your example you did not leave a line break before the URL to be oneboxed. Here it is looking as expected.