[Teak] Discussion topics disappear immediately after clicking (API returns 200 OK with empty results)

Hi everyone,

I’m running into a strange issue with the Discussion MFE on the Teak release (Open edX). I’m hoping someone can help me understand if this is a configuration issue or a bug.

The Symptom: When a user clicks certain topics in the sidebar, the topic is selected for a split second (approx. 100ms) and then immediately disappears from the list. The main content area then displays “No results found.”

I’ve made a small GIF of the problem: OpenEdx Discussion Topics Bug - Album on Imgur

What I’ve Checked: I initially thought this was a frontend issue (like a stuck “Unread” filter), but I checked the browser Network logs and the request looks clean. The API is returning a 200 OK status, but the results list is empty.

  • Request: GET /api/discussion/v1/threads/?course_id=...&topic_id=[UUID]

  • Response:

    JSON

    {
        "results": [],
        "pagination": {
            "next": null,
            "previous": null,
            "count": 0,
            "num_pages": 1
        }
    }
    
    

Debugging Attempt: To verify if the MFE logic was removing the item erroneously, I tried intercepting the fetch request in the console and returning a dummy JSON object for that topic_id. When I did that, the sidebar kept the topic visible, which suggests the Frontend code is behaving correctly when it receives data.

The Question: It seems like the Sidebar (Blockstore?) thinks these topics exist, but the Discussion Service (SQL?) returns nothing for them.

Has anyone seen this mismatch between the sidebar structure and the discussion backend in Teak? I am wondering if I am missing a migration step, or if there is a specific management command I should run to re-sync the topic IDs?

Thanks in advance for any pointers!

@Rasmus_Ploug is this a fresh installation or was it upgraded from a previous release?

A fresh installation

OK. I posted in the #forums-migration-fc-77 Slack channel to ask someone to get some :eyes: on this question.

Another strange issue I’ve noticed in Teak is that when accessing course content, if I open the discussion forum from the right-side panel and create a new post, the post disappears after I refresh the page and open the same discussion panel again.

I’m using Teak (Tutor 20.0.2)

@Rasmus_Ploug, @Mahendra do you guys have a waffle flag named forum_v2.enable_mysql_backend created and enabled?

More about the changes in discussion backend in the teak release can be found here (the part starts with “The new Forums implementation…”)

@Anh_Vu_Nguy_n

By default, forum_v2.enable_mysql_backend already enabled at /admin/waffle/flag/

Today I did a fresh installation using Teak.2 (Tutor 20.0.2) again, but I faced both issues again.

I also have that flag created and enabled by default.. @Mahendra I also have this issue with the right-side panel. Glad to know im not the only one

Hi @Rasmus_Ploug , thanks for pointing out this issue. It is a known issue and has been fixed in the newer release of openedx-forum (0.3.8). Teak release is using the openedx-forum(0.3.6). You can upgrade the forum version and I hope it will fix your issue. Thanks

1 Like

Hello. We are using the newer tutor-forum plugin (version 20.0). Is it true you’re referencing the older version?

@Abdul_Rehman Can you please point out the PR that fixed this issue in openedx-forum? It will help us apply the patch. Thanks.

@Abdul_Rehman I tried GitHub - openedx/forum: Python rewrite of the legacy Open edX Ruby forum 0.3.8, but still these both issues are the same. I can see https://sandbox.openedx.org/, and everything is working fine. Is https://sandbox.openedx.org/ using Teak or master?

As the latest teak (teak.3) is using 0.3.6 version of openedx-forum and the issue related to topics is not reproduced in ulmo, the first thing that came to my mind was to upgrade the version of openedx-forum. But, I have verified now this is not an issue with the openedx-forum but with edx-platform. After doing thorough debugging, I have validated this issue (related to Topics) was implicitly fixed in the following PR:

The real issue was in the file: openedx/core/djangoapps/django_comment_common/common_client/thread.py

In the seach method, the commentable_ids and commentable_id were being converted into list only conditionally (when query_params contain ‘search’ parameter), and not otherwise. But, the above PR fixed this issue.
Here’s the reference from teak:

I will try to debug the other issue and update soon.

1 Like

I’ve asked @Taimoor_Ahmed to help us get the fixes backported to Teak so forums will work on Teak.

1 Like

Thanks @Abdul_Rehman

This is really helpful for us.