Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: exclude anonymous posts in build_course_stats INF-887 #423

Closed

Conversation

eemaanamir
Copy link

Co-Contributor: @sohailfatima

Ticket: https://2u-internal.atlassian.net/browse/INF-887

Fix:
Update line 276 in cs_comments_service/models/user.rb

   ` { "$match" => { :course_id => course_id, :author_id => self.external_id, "anonymous_to_peers" => false, "anonymous" => false} },`

Explanation:

When a user makes their first non-anonymous post, the system uses the "build_course_stats" function to create a new set of statistics for that user. However, there is a problem with the current implementation of the function. It counts all the posts made by a specific user, including those that are anonymous or were made anonymously to peers, before the user made their first non-anonymous post. This leads to an inaccurate count of the user's threads being saved in the database. In other words, the function doesn't filter out the posts made before the user started posting non-anonymously, causing the stored count to be incorrect.

Note: this fix is not backward compatible as that would require direct changes to the database.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 21, 2023
@openedx-webhooks
Copy link

Thanks for the pull request, @eemaanamir! 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:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

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.

⚠️ We can't start reviewing your pull request until you've submitted a signed contributor agreement or indicated your institutional affiliation. Please see the CONTRIBUTING file for more information. If you've signed an agreement in the past, you may need to re-sign. See The New Home of the Open edX Codebase for details.

Once you've signed the CLA, please allow 1 business day for it to be processed. After this time, you can re-run the CLA check by adding a comment here that you have signed it. If the problem persists, you can tag the @openedx/cla-problems team in a comment on your PR for further assistance.

Copy link

codecov bot commented Nov 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f408aa2) 96.14% compared to head (14a7184) 96.16%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #423      +/-   ##
==========================================
+ Coverage   96.14%   96.16%   +0.02%     
==========================================
  Files          58       58              
  Lines        4562     4588      +26     
==========================================
+ Hits         4386     4412      +26     
  Misses        176      176              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@itsjeyd
Copy link

itsjeyd commented Nov 23, 2023

Hey @eemaanamir, thank you for this contribution!

As the bot says, the next step will be for you to submit a signed CLA. Once that's done and the build is green, we can line this PR up for engineering review.

@itsjeyd itsjeyd added the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Nov 23, 2023
@itsjeyd
Copy link

itsjeyd commented Dec 7, 2023

Hi @eemaanamir, did you get a chance to submit a CLA yet? Just want to make sure it's not stuck in processing.

@itsjeyd
Copy link

itsjeyd commented Jan 12, 2024

Hey @eemaanamir, just checking in to see if you're still planning to get this PR merged?

@xitij2000
Copy link
Contributor

xitij2000 commented Jan 12, 2024

@itsjeyd

I think almost this exact same code has been merged in this PR: #424

So I am closing this PR as a duplicate.

@xitij2000 xitij2000 closed this Jan 12, 2024
@openedx-webhooks
Copy link

@eemaanamir Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.

@itsjeyd
Copy link

itsjeyd commented Jan 18, 2024

Noted, thanks @xitij2000.

@itsjeyd itsjeyd added duplicate This issue or pull request already exists elsewhere and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists elsewhere open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants