Repository navigation
Render a forum thread when an edit has no author - #20989
Conversation
|
Hey @tsayin4 - this is a great change, but it looks like your commit is unsigned. You can either set up signing and re-sign it yourself, or I can force push over and sign it for you! |
|
Thanks Ian. Please go ahead and force push over it — that is the quickest way to get it in. I am setting up SSH commit signing on my side now, so anything I send after this will come in signed. One thing worth flagging from the same file, in case it is useful: the post author two lines below the edits list has the same shape. |
A deleted profile leaves edit.by.data null. Days destructured it directly, so the thread threw "Cannot destructure property 'id' of 'e.by.data' as it is null" and the reader lost the whole page. The tooltip is built while Days renders rather than when it opens, which is why a hover-only element took the page down on load. The missing author now falls back to "Deleted user" and the name is not linked, since the profile it would point at is gone. Keeping the row rather than skipping it means the edit history still matches the "Edited" label on the trigger. The post author two lines below has the same shape - profile is optional in the props but was read without a guard - so a deleted original poster would fail the same way. Same treatment. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01AqD13QkB8DhzkDSdKbJScv
Head branch was pushed to by a user without write access
e8c0e71 to
6158670
Compare
|
Signed and force-pushed, so no need to spend your push on it - While I was in there I fixed a second instance of the same shape two lines below: the post author's Thanks for the quick review. |
|
Merged! Thanks for your contribution to posthog.com - we really appreciate it. 🤜🤛 |
Fixes #20937
A deleted profile leaves
edit.by.datanull.Daysdestructured it directly, so the thread threwCannot destructure property 'id' of 'e.by.data' as it is nulland the reader lost the whole page.Worth noting why a tooltip took the page down: the content is built while
Daysrenders, not when the tooltip opens. So a hover-only element crashed on load.The missing author now falls back to "Deleted user", and that name is not linked — the profile it would point at is gone, so the link would 404.
On the choice between the two options in the issue: I kept the row rather than skipping it. The trigger already says "Edited", so dropping the row would leave the label contradicting a list that does not show the edit.
getAvatarURLalready acceptsundefinedandAvatarfalls back to its default hog, so no extra handling was needed there.One thing not in the report. The post author two lines below has the same shape:
profileis optional in the props (profile?: any) but was read without a guard, so a deleted original poster would take the thread down the same way. Same treatment applied. I have not seen that one in the wild — it is the same class, not a second report.What I did not do: I could not run the site locally, so this is verified by reading.
npx prettier@2 --writeon the file produces no further changes, matching the version inpackage.json.🤖 Generated with Claude Code
https://claude.ai/code/session_01AqD13QkB8DhzkDSdKbJScv