Making WordPress.org

Opened 5 years ago

Closed 4 weeks ago

Last modified 3 weeks ago

#4275 closed defect (bug) (fixed)

Reviews that are moderated, do not keep their ratings

Reported by: dd32's profile dd32 Owned by: dd32's profile dd32
Milestone: Priority: normal
Component: Support Forums Keywords:
Cc:

Description

Currently when a review is moderated, the original review is moved to an 'archived' status and a new 'public' status review it put into it's place.

Sometimes this can be for something as trivial as removing a link to the reviewers site.

When that happens, the ratings data stays attached to the post_id of the archived post, and the new public review doesn't have an attached ratings record.

The public view of the rating will still show the rating (as ratings there are queried by user_id) but a plugin directory review view won't as it'll skip over the rating record for the archive'd review.

There's two options here, of which only the first seems like a real fix

  • Keep the ratings record linked to the correct post_id of the review
  • Change the plugin directory to query the Support forum threads, and then look up the ratings for each by user_id, instead of the current 'Query all ratings, and pull their associated posts' which is far more performant given the number of reviews vs support posts.

Change History (10)

#1 @dd32
5 years ago

An example of where this happened (I've corrected the underlying data) was here: https://wordpress.slack.com/archives/C02QB8GMM/p1552596311241700

This ticket was mentioned in Slack in #meta by tellyworth. View the logs.


5 years ago

#3 @tellyworth
5 years ago

  • Owner set to dd32
  • Status changed from new to assigned

This ticket was mentioned in Slack in #forums by dd32. View the logs.


2 years ago

This ticket was mentioned in Slack in #forums by vladytimy. View the logs.


14 months ago

This ticket was mentioned in Slack in #meta by dd32. View the logs.


4 weeks ago

#7 @dd32
4 weeks ago

When that happens, the ratings data stays attached to the post_id of the archived post, and the new public review doesn't have an attached ratings record.

...Because Reviews can only have a singular review per user+plugin combination - So when the user adds a second review that can be accepted, the underlying ratings code is saying "Oh we've already stored that user rating" and not storing it still...

In this case, we probably need to update the ratings table to refer to the latest review post, rather than the first.

#8 @dd32
4 weeks ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In r21952-dotorg:

Ratings: Update the post_id of the review when setting a users review rating, add a cache clear method.

This fixes the case of a review being archived, and the followup review not containing the proper linked review metadata.

Fixes https://meta.trac.wordpress.org/ticket/4275

#9 @dd32
4 weeks ago

In 13540:

Support Forums: Clear the rating caches upon a review being archived.

See #4275.

#10 @dd32
3 weeks ago

In 13582:

Support Forums: Reviews: Track the review rating with the topic, rather than the shared ratings table.

Users can have their reviews moderated / hidden if they violate the forum guidelines, and subsequent reviews will replace the users review for all reviews instead of just the new one.
This allows us to keep a history of the rating for a review, even if a newer review from the user has a different rating.

See #4275, #7064.

Note: See TracTickets for help on using tickets.