-
Notifications
You must be signed in to change notification settings - Fork 154
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
fix: exclude anonymous posts in build_course_stats INF-887 #423
Conversation
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:
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. 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 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
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. |
Hi @eemaanamir, did you get a chance to submit a CLA yet? Just want to make sure it's not stuck in processing. |
Hey @eemaanamir, just checking in to see if you're still planning to get this PR merged? |
@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. |
Noted, thanks @xitij2000. |
Co-Contributor: @sohailfatima
Ticket: https://2u-internal.atlassian.net/browse/INF-887
Fix:
Update line 276 in cs_comments_service/models/user.rb
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.