Impossible to prevent x.com oneboxes (and they're broken)

AI-generated summary

A bug report highlights that x.com (formerly Twitter) oneboxes are consistently broken, regardless of the blocked_onebox_domains site setting. RGJ demonstrated that even when attempting to block these domains, the generated HTML remains empty, failing to display the tweet description, author, or date. The issue persists whether the domain is blocked or not, indicating a fundamental failure in the onebox generation logic for x.com links. zogstrip confirmed that a fix is available and will be implemented via pull request #38868 on the Discourse GitHub repository.

  • Add x.com and twitter.com to the blocked_onebox_domains site setting
  • Create a new post
  • Enter a link to x.com on its own line
  • See how you do get a (broken) onebox

Whether the onebox is broken or not does not depend on the value of the blocked_onebox_domains site setting. They are always broken.
Generated HTML, see how basically everything is empty.

<aside class="onebox twitterstatus" data-onebox-src="https://x.com/The_Kremlinn/status/2028700091154940405">
  <header class="source"><svg class="fa d-icon d-icon-fab-twitter svg-icon fa-width-auto svg-string" width="1em" height="1em" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="#fab-twitter"></use></svg>

      <a href="https://x.com/The_Kremlinn/status/2028700091154940405" target="_blank" rel="noopener">x.com</a>
  </header>

  <article class="onebox-body">
    
<h4><a href="https://x.com/The_Kremlinn/status/2028700091154940405" target="_blank" rel="noopener"></a></h4>
<div class="twitter-screen-name"><a href="https://x.com/The_Kremlinn/status/2028700091154940405" target="_blank" rel="noopener">@</a></div>

<div class="tweet">
  <span class="tweet-description"></span>
</div>

<div class="date">
  <a href="https://x.com/The_Kremlinn/status/2028700091154940405" class="timestamp" target="_blank" rel="noopener"></a>


</div>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
5 Likes

Will be fixed by

https://github.com/discourse/discourse/pull/38868

4 Likes