Skip to content

Render a forum thread when an edit has no author - #20989

Merged
ianmatson merged 1 commit into
PostHog:masterfrom
tsayin4:fix/20937-days-deleted-author
Oct 9, 2026
Merged

ianmatson merged 1 commit into
PostHog:masterfrom
tsayin4:fix/20937-days-deleted-author

Conversation

@tsayin4

@tsayin4 tsayin4 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #20937

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.

Worth noting why a tooltip took the page down: the content is built while Days renders, 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. getAvatarURL already accepts undefined and Avatar falls 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:

color={profile.attributes.color}
...
profileID={profile.id}

profile is 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 --write on the file produces no further changes, matching the version in package.json.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AqD13QkB8DhzkDSdKbJScv

@github-actions github-actions Bot added the website About the website (beyond just landing pages) label Oct 8, 2026
@ianmatson
ianmatson enabled auto-merge (squash) October 8, 2026 22:48
@ianmatson
ianmatson disabled auto-merge October 9, 2026 01:06
@ianmatson
ianmatson enabled auto-merge (squash) October 9, 2026 01:07
@ianmatson

Copy link
Copy Markdown
Contributor

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!

@tsayin4

tsayin4 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

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. profile is optional in the props but was read without a guard, so a deleted original poster would take the thread down the same way. I included that in the change. I have not seen it happen in the wild — it is the same class, not a second report.

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
auto-merge was automatically disabled October 9, 2026 14:12

Head branch was pushed to by a user without write access

@tsayin4
tsayin4 force-pushed the fix/20937-days-deleted-author branch from e8c0e71 to 6158670 Compare October 9, 2026 14:12
@tsayin4

tsayin4 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Signed and force-pushed, so no need to spend your push on it - 6158670 now verifies, and it is rebased onto master as a single commit instead of carrying the merge commit. Signing is set up on my side now, so anything I send after this arrives signed.

While I was in there I fixed a second instance of the same shape two lines below: the post author's profile is optional in the props but was read without a guard, so a deleted original poster took the thread down the same way. Worth a look since it is a separate code path from the one in the issue.

Thanks for the quick review.

@ianmatson
ianmatson merged commit ecb5105 into PostHog:master Oct 9, 2026
22 checks passed
@ianmatson

Copy link
Copy Markdown
Contributor

Merged! Thanks for your contribution to posthog.com - we really appreciate it. 🤜🤛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

website About the website (beyond just landing pages)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Bug Report: Forum thread crashes when an edit has no author

2 participants