Weird loading behavior when viewing this topic https://meta.discourse.org/t/66812

AI-generated summary

A bug report details unusual loading behavior in a Discourse topic, where opening certain posts results in a blank page or repeated loading. anon59994034 describes the issue across multiple browsers and provides screenshots and console output. supermathie confirms the problem in an incognito tab. Falco suggests a potential fix involving a nil currentUser check. andrei confirms the issue and identifies the root cause: a crash occurs when an anonymous user views a topic with a post mentioning a user whose status has an end date. andrei provides a fix via a GitHub pull request.

repro steps:
(tested in firefox 110.0, chrome 110.0.5481.104, edge 110.0.1587.50)

  1. log out
  2. open one of the first several posts in the topic
    Quick image resizing and markdown image dimensions
  3. open one of the remaining posts and then keep scrolling down
    Quick image resizing and markdown image dimensions - #20 by elijah

Opening the first several posts results in a blank topic

Opening the remaining posts and then keep scrolling down, will keep loading the posts repeatedly
(pay attention to the “very good” image)

Console output:

5 Likes

All I need to do is bring it up in an incognito tab, yeah something’s wrong:

5 Likes

cc @andrei

Do we need a guard for nil currentUser here?

3 Likes

I’m able to reproduce it, working on the fix now.

4 Likes

This happens when:

  1. Some post of a topic contains a mention, and
  2. The mentioned user has user status set, and
  3. That status has an end date

If an anonymous user tries to load such a topic, this error happens.

And here is the fix:
https://github.com/discourse/discourse/pull/20660

8 Likes

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