Skip to content

fix: inconsistent loading of discussion thread response#368

Open
naincy128 wants to merge 2 commits into
release-ulmofrom
naincy128/LP-529
Open

fix: inconsistent loading of discussion thread response#368
naincy128 wants to merge 2 commits into
release-ulmofrom
naincy128/LP-529

Conversation

@naincy128

@naincy128 naincy128 commented Jun 29, 2026

Copy link
Copy Markdown

Description

Fixes an issue where inline replies within discussion threads could load inconsistently, causing some replies to appear or disappear between page refreshes.

Root Cause

Response comments were not being retrieved using backend-level pagination. Combined with frontend request race conditions and stale state handling, this could result in inconsistent loading of inline replies, especially in threads with many responses.

As a result, users could see different combinations of replies on successive page refreshes, even though the underlying discussion data was unchanged.

Changes

Backend (edx-platform)

  • Updated response comment retrieval to use forum backend pagination APIs (get_comments and get_comments_count).
  • Moved response-comment pagination to the forum backend for more reliable and efficient loading.
  • Removed unused code related to the previous pagination approach.

Frontend (frontend-app-discussions)

  • Added request cancellation using AbortController to prevent stale requests from overwriting newer data.
  • Cleared stale child-comment state when reloading response comments.

Linked PR

frontend-app-discussions

Ticket

LP-529

Comment thread lms/djangoapps/discussion/rest_api/api.py Outdated
Comment thread lms/djangoapps/discussion/rest_api/api.py Outdated
Comment thread lms/djangoapps/discussion/rest_api/api.py Outdated

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings July 3, 2026 11:49

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings July 6, 2026 05:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment on lines +2336 to 2344
# Filter muted content
include_muted_param = request.GET.get("include_muted", False)
include_muted_param = include_muted_param in ["true", "True", True]
if not include_muted_param:
response_comments = filter_muted_content(
request.user,
context["course"].id,
response_comments
)
Comment thread lms/djangoapps/discussion/rest_api/api.py
Comment thread lms/djangoapps/discussion/rest_api/api.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants