Skip to content

Henry/Reviews-fix#1137

Open
Henrp wants to merge 34 commits into
mainfrom
reviews
Open

Henry/Reviews-fix#1137
Henrp wants to merge 34 commits into
mainfrom
reviews

Conversation

@Henrp
Copy link
Copy Markdown
Contributor

@Henrp Henrp commented Apr 22, 2026

Removed overall rating

Henrp and others added 30 commits March 25, 2026 19:17
…y did not put course subject/number in input data and did not allow for selection of class semester from the dropdown)
@Henrp Henrp requested a review from ARtheboss April 22, 2026 00:11
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f5131266c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +91 to +92
disabled={!selectedCourse || termOptionsLoading}
loading={termOptionsLoading}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore course selection in add-rating modal

RatingFormBody now disables semester selection when selectedCourse is null, but this form no longer includes any control to set selectedCourse. In the Profile “Add Rating” flow, UserFeedbackModal is opened without an initialCourse, so users are stuck with disabled selects and cannot reach a valid submit state; this regresses adding ratings from Profile entirely.

Useful? React with 👍 / 👎.

Comment on lines +1325 to +1326
const ratings = await RatingModel.find({ subject, courseNumber }).lean();
const sections = await SectionModel.find({ subject, courseNumber })
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Query class reviews by courseId to include cross-listings

getClassRatings fetches ratings/reviews by (subject, courseNumber) instead of courseId, which drops data submitted under cross-listed aliases. The rest of this module (e.g., createRatings) explicitly keys user ratings by courseId for cross-list support, so classReviews can now show incomplete/mismatched data on cross-listed course pages.

Useful? React with 👍 / 👎.

Comment on lines +1276 to +1279
await ReviewModel.updateOne(
{ _id: review._id },
{ $addToSet: { helpfulVoters: userId }, $inc: { helpfulCount: 1 } }
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make helpful vote increments atomic per voter

The upvote path combines $addToSet with unconditional $inc: { helpfulCount: 1 } after a non-transactional read. If two requests from the same user race, only one voter entry is added but both increments apply, so helpfulCount drifts above the true voter count; the inverse can happen on rapid unvotes as well. This should be guarded by a conditional update filter (or transaction) so count changes only when membership actually changes.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants