jointakahe / takahe

An ActivityPub/Fediverse server
BSD 3-Clause "New" or "Revised" License
1.12k stars 86 forks source link

"SHOW" on CW in web interface not expanding post #715

Open futzle opened 4 months ago

futzle commented 4 months ago

A reader of fedi.vision (Takahe 0.10) noticed this small issue with expanding CWs in the web view interface.

Example page: https://fedi.vision/@vote@fedi.vision/replies/

  1. Go to above page. (Firefox but also reported on other browsers.)
  2. Find a post with a CW.
  3. Click on SHOW.

Expected result: Post is expanded.

Actual result: no change is visible on the web page; it remains collapsed.

Here's what is happening in the Javascript console:

Document.querySelectorAll: '.summary-{self.id} .summary' is not a valid selector [hyperscript.min.2e9b5242ff02.js:1:51625](https://fedi.vision/static/js/hyperscript.min.2e9b5242ff02.js)
hypertrace /// [hyperscript.min.2e9b5242ff02.js:1:21927](https://fedi.vision/static/js/hyperscript.min.2e9b5242ff02.js)
  -> on click or keyup   - 
<div class="summary" _="on click or keyup[key is…d} .content/> then halt" tabindex="0">

The target <div> itself has this class:

<div class="post  summary-{self.id}" data-takahe-id="317611159932175328" role="article" tabindex="0">
...
</div>

Is {self.id} meant to have been substituted with something during rendering of the HTML page? All the CW'd posts on the page have the same class.

The post itself federates to other servers fine, and it views fine in mobile clients. This is just a problem with the web view.

futzle commented 4 months ago

Suspect this line here: https://github.com/jointakahe/takahe/blob/024b01a144dd1fc164c0617217de15b79a43d033/activities/models/post.py#L463

futzle commented 4 months ago

Confirming that #716 applied manually to my instance fixes the problem. Thanks!