Can admins no longer see who deleted a post?

AI-generated summary

The discussion centers around a bug introduced with the recent update to Glimmer components, causing admins to no longer see who deleted a post. Previously, the avatar of the deleting user was displayed. piffy noticed the change and questioned if it was intentional. ondrej confirmed it was easier to identify the deleter with the previous display. Moin investigated the code and found the relevant code still exists, suggesting a broken implementation. They provided code snippets and a screenshot of their attempts to restore the functionality, but couldn’ t get the avatar to display. Michael12 built on Moin’s findings, suggesting that @post.deleted_by might not be correctly passed to the component and proposed checking the API response. Moin requested specifics on Michael12’s tweak and agreed with the API suggestion. Ultimately, saquetim identified it as a bug and provided a fix through a pull request (saquetim, https://github.com/discourse/discourse/pull/3330).

I know the avatar of the person who deleted a post used to show up at the bottom but now I no longer see it. Was this an intentional design choice?

7 Likes

I see what you mean. It is easier to see who deleted the post from the post as opposed to going to the logs.

5 Likes

I don’t think it was an intentional change. The code is still there. I think something broke when the post widgets were updated to Glimmer components.

When I change this to

{{#if @post.deleted_at}}

and also edit line 14

{{formatDate @post.deleted_at format="tiny"}}

I am able to restore most of it.

But I wasn’t able to make the avatar work. Based on

I thought it would be

<UserAvatar @size="tiny" @user={{@post.deleted_by}} />

but that didn’t work.

5 Likes

Jumping in here, thanks for the detailed breakdown, Moin. I tried a similar tweak and ran into the same issue with the avatar not displaying. It looks like @post.deleted_by isn’t getting passed correctly to the component, even though the model has the deleted_by property. Maybe it’s not being included in the post serializer or not tracked correctly through the Glimmer component layer?

Might be worth checking if deleted_by is exposed in the API response for the post. If not, that could explain why UserAvatar isn’t getting any user data. Just a thought. Curious if anyone’s found a full fix.

What did you try?

Great idea! Would you do that and share the result?

Thank you for the detailed report.

It is indeed a small bug introduced with the Glimmer components.

I’ll fix it as soon as possible.

5 Likes

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

The issue will be fixed by the PR above.

7 Likes

This topic was automatically closed after 4 days. New replies are no longer allowed.