Infinite Scrolling Requests After Topic Deletion

AI-generated summary

A bug report titled “Infinite Scrolling Requests After Topic Deletion” describes an issue where, after a topic is deleted, a user attempting to scroll through it triggers continuous posts.json API requests that return 403 Forbidden errors. This creates an infinite loop of failed requests, disrupting the user experience. The issue occurs when a regular user views a topic that is later deleted by an admin or moderator. The steps to reproduce involve creating a topic, opening it in another tab, and scrolling after deletion. The problem is linked to the application failing to recognize the topic deletion and stop attempting to load non-existent content. A user asks for the current Discourse version, noting a similar bug was recently fixed here.

Overview

When a user is actively viewing a topic that is subsequently deleted, continuous scrolling (up or down) triggers an infinite loop of posts.json API calls. These calls consistently return a 403 Forbidden error, yet the application fails to acknowledge the deletion or stop attempting to load non-existent content, leading to persistent background network activity and a broken user experience.

Steps to Reproduce

  1. Preparation (Admin/Moderator User):
  • Log in as a user with topic deletion privileges (e.g., Administrator or Moderator).
  • Create a new topic with a few posts to ensure there’s content to scroll through.
  • Keep this topic’s page URL handy.
  1. User Experience (Regular User):
  • Log in as a regular user (without deletion privileges).
  • Open a new browser tab or window.
  • Navigate to the topic created in Step 1.
  • Open your browser’s developer tools and go to the “Network” tab. Clear any existing requests for a clean view.
  1. Simultaneous Deletion & Interaction:
  • While the regular user is on the topic page (from Step 2), use the Administrator/Moderator account (from Step 1) to delete the topic.
  • Immediately after the topic is deleted, the regular user attempts to scroll up or down on the now-deleted topic’s page.
  1. Observe:
  • In the regular user’s browser’s Network tab, observe continuous GET requests being sent to https://discourse-url/t/xxxxx/posts.json? (where xxxxx is the deleted topic ID).
  • Notice that all these requests consistently return a 403 Forbidden HTTP status code.
  • The application does not display any message indicating the topic has been deleted, nor does it stop sending these failed scroll requests.

Potential Consequences

  • In my community, we use Cloudflare to prevent cyberattacks, and this bug caused some users to make too many requests and be rate-limited.
1 Like

What is your current Discourse version?

There was a similar bug report recently which was fixed

3 Likes