bug: Viewing anonymous questions/answers causes crash on frontend
Anonymous questions and answers causes an error in Backstage if the person viewing the question is not the author of the question.
The culprit seems to be this line const { primaryTitle: userName } = useEntityPresentation(entityRef); in UserLink
useEntityPresentation expects a valid entity reference I suppose and since the anonymous check is executed after then it gets passed the string 'anonymous' and crashes.
Moving the if (entityRef === 'anonymous') above useEntityPresentation works but the linter will complain about that since useEntityPresentation is a react hook.
Image of error:
I can create a PR with a possible fix.
Thanks for the report! If you can come up with a PR, it would be much appreciated!
@Revyy can you verify the fix in the new release so we can close this? Thanks!