openedx / frontend-app-discussions

A React-based micro frontend for the Open edX discussion forums.
GNU Affero General Public License v3.0
6 stars 61 forks source link

fix: posts sorting on sidebar #686

Open dyudyunov opened 3 months ago

dyudyunov commented 3 months ago

Description

Fix wrong sorting when a user creates several posts without the page reloading.

Steps to reproduce

  1. [Precondition] The new discussions experience (discussions sidebar) should be enabled
  2. Navigate to any course unit where the discussions sidebar is enabled
  3. Create a new post.
  4. Click on the "Back to list" button. Note that the default sorting is used (most recent first) and it's correct.
  5. Create another post without reloading the page
  6. Click on the "Back to list" button and check the result

Actual result

The second created post is the last in the list (the same for any number of posts created additionally).

image

Expected result (with the fix applied)

Sorting works as expected - most recent posts are displayed first.

discuss_sorting

Additional Notes

openedx-webhooks commented 3 months ago

Thanks for the pull request, @dyudyunov! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

dyudyunov commented 3 months ago

My changes require further improvements - there are unneeded additional GET requests to the threads endpoint.

I will change the status to Draft for now

dyudyunov commented 3 months ago

My changes require further improvements - there are unneeded additional GET requests to the threads endpoint.

I will change the status to Draft for now

I figured out how to get rid of the unneeded API call, now it's ready for the review

dyudyunov commented 3 months ago

Tests CI seems to be canceled because of the timeout Error: The operation was canceled. Failing after 360m

Does anyone know the reason?

awais-ansari commented 3 months ago

Tests CI seems to be canceled because of the timeout Error: The operation was canceled. Failing after 360m

Does anyone know the reason?

@dyudyunov Not sure about it.

dyudyunov commented 2 months ago

Rebased on fresh master branch

Hope it will fix the pipeline timeout issue

mphilbrick211 commented 2 months ago

Hi @dyudyunov! Do you still need help with this? If so, I can look into it for you.

dyudyunov commented 1 month ago

Hi @mphilbrick211

Sorry for the delayed response

Yes, I need some help here, the timeout issue is still reproducing (I rebased the working branch today to re-check) and I don't know the reason. I also saw that other PRs have the same issue

mphilbrick211 commented 1 month ago

Hi @mphilbrick211

Sorry for the delayed response

Yes, I need some help here, the timeout issue is still reproducing (I rebased the working branch today to re-check) and I don't know the reason. I also saw that other PRs have the same issue

Checking on this for you, @dyudyunov!