Hi @Ayesha_Waris! I noticed that you are an active reviewer in Discussion MFE. Perhaps you can help with this issue, or perhaps you know who to ping to fix this error.
When trying to filter by Following
on the Unit page (Learning MFE), a 400 error appears in the Discussion sidebar. Although, for the same filtering on the Discussion page (Discussion MFE), everything works correctly:
-
In Discussion sidebar:
-
On Discussion page:
I found that the backend requests are slightly different for these pages:
- error 400
{
"page": 1,
"page_size": 10,
"course_id": CourseLocator("edX", "L153", "1T2024", None, None),
"topic_id": {
"b09d51c7-c5e5-4e7f-8616-94c37a9bf027",
},
"text_search": "",
"following": True,
"author": "",
"thread_type": "question",
"count_flagged": None,
"flagged": None,
"view": "",
"order_by": "last_activity_at",
"order_direction": "desc",
"requested_fields": {"profile_image"},
}
- code 200
{
"page": 1,
"page_size": 10,
"course_id": CourseLocator("edX", "L153", "1T2024", None, None),
"topic_id": set(),
"text_search": "",
"following": True,
"author": "",
"thread_type": "question",
"count_flagged": None,
"flagged": None,
"view": "",
"order_by": "last_activity_at",
"order_direction": "desc",
"requested_fields": {"profile_image"},
}
An error occurs because both the following
parameter and the topic_id
parameter are passed simultaneously. These parameters are part of the EXCLUSIVE_PARAMS = ["topic_id", "text_search", "following"]
list. This means that only one of these parameters can be used in each request.
However, in the context of Learning MFE will always be passed topic_id
.
There are several options for solving this issue:
- remove the ability to filter by the
following
parameter for the sidebar. - change the filtering logic in the Forum service.
Many thanks for considering my request.