Closed Bug 804998 Opened 9 years ago Closed 9 years ago

Reviews counter is not working as expected

Categories

(Marketplace Graveyard :: Consumer Pages, defect, P2)

x86_64
Windows 7
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: vcarciu, Assigned: robhudson)

References

()

Details

(Whiteboard: [ugh-caching] p=3)

Prerequisites:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/19.0 Firefox/19.0

Steps to reproduce:
1.Go to MP and open a rated app
2.Observe that there is a button for opening all reviews, containing the average stars given and a counter for the number of reviews

Expected results:
The number of the reviews is equal with the number from the button presented at step 2.

Actual results:
The counter is not working as expected and the number of reviews is not the same with the number displayed on the button from step 2.

Please see screencast for this bug : http://screencast.com/t/EEeYcfE4wBUv

NOTES:
Reproducible also in production.
I assume this is related to only showing reviews from the current version.  -> rob
Assignee: nobody → robhudson.mozbugs
Priority: -- → P2
Target Milestone: 2012-10-25 → 2012-11-01
Happy to look. The screencast shows hosted apps, however, which shouldn't have multiple versions.

The reviews have a few denormalized fields that don't seem to be updating properly, which happens in a task. Or the task runs but the queries are wrong. I'll take a good look.

See also bug 805286.
With help from Basta we've got a theory, which I'll test tomorrow...

The tasks are doing aggregate queries and assigning the results to the denormalized fields on the addons table. But it's using `.filter(...).update(...)`, which calls Django's `update` which does a SQL UPDATE and doesn't sign pre/post save signals, which is what django-cache-machine uses to invalidate its cache. So the values are updating in the db, but django-cache-machine is still returning the old values from cache.

Since we have the object already, I'm going to just update it to use our obj.update(...) call, which also does a SQL UPDATE but also sends the appropriate signals. This should invalidate the queries in django-cache-machine and let the correct totals stashed on the addon table come through.
https://github.com/mozilla/zamboni/commit/34595c7114e6d2a3aace348a43bd6ce13c5ee22e
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
I am not sure if the change is applied only from now, but the issue is still reproducible for some apps : http://screencast.com/t/Z6t9v3HY
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
The patch to fix this hasn't gone out to prod yet. When it does, we could either blow away memcache or run a script that targets webapps with reviews to force them to clear the cache that is keeping these from showing the correct values.
closing for comment 6
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
Verified as fixed : http://screencast.com/t/SNPT3u19Oaj
Status: RESOLVED → VERIFIED
I am not sure if we have the same issue here , but the reviews counter is not working as expected again (use https://marketplace-dev.allizom.org/app/ffdoku/?src=mkt-search) : http://screencast.com/t/aMwegKJx
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Target Milestone: 2012-11-01 → ---
Whiteboard: [janus] → [ugh-caching] p=3
This is no longer an issue in Fireplace thanks to the API.
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.