Closed Bug 805286 Opened 9 years ago Closed 9 years ago

Displaying "Not yet rated 0 reviews" for app with 1 review

Categories

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

x86
macOS

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mhanratty, Assigned: robhudson)

References

Details

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

Attachments

(2 files)

Confusing screen. 

1. The app has 1 review but text says it has 0 reviews (Related to this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=804998)

2. Apps with 0 reviews do not have this button. They display text "This app is not yet rated and the "Write a Review" button.
Screenshot of app with has 0 reviews
See Also: → 804998
Assignee: nobody → robhudson.mozbugs
Severity: normal → minor
Priority: -- → P3
Target Milestone: --- → 2012-11-01
https://github.com/mozilla/zamboni/commit/34595c7114e6d2a3aace348a43bd6ce13c5ee22e

This fixes the cause. To fix the symptom we just need to re-save the add-on, which should reset its cache and pull in the proper counts from the database.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Issue from the step 1 (The app has 1 review but text says it has 0 reviews Not yet rated) is still reproducing.
Verified on FF19 (Win 7)
Please see screencast http://screencast.com/t/qhxosQAb
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
The task that updates the denormalized fields is failing on hosted apps that have multiple versions. It works fine otherwise. Hosted apps technically shouldn't have multiple versions but we have some that do because of an old cron job that was checking manifests and creating new versions.

Andrew and I agreed that we should collapse versions for hosted apps.

I'll write a migration that does roughly the following:
* For all hosted, active web apps:
* Get the latest version
* Get all versions that aren't the latest version and:
  * Update any related records pointing to this version to point to the latest version
  * Delete this version & file from the db

That should fix this problem and possibly future problems from hosted apps and versions not being consistent.
Target Milestone: 2012-11-01 → 2012-11-15
(In reply to Rob Hudson [:robhudson] from comment #5)
> The task that updates the denormalized fields is failing on hosted apps that
> have multiple versions.

Aww, why is that?
Target Milestone: 2012-11-15 → 2012-11-22
The collapsing versions script was added over a few commits and tested against the data on -dev.  I'll test hosted apps with zero reviews and see if I can still reproduce. If not, we could run the script against prod also.
I was able to reproduce on an app and verified it had only a single version:
https://marketplace-dev.allizom.org/app/ginger/

It also worked correctly on another app:
https://marketplace-dev.allizom.org/app/mindseng/
Target Milestone: 2012-11-22 → 2012-11-29
Trying one more time...
https://github.com/mozilla/zamboni/commit/9cb4297 

I found a race condition only sometimes when the addon was saved and it having stale data which overwrote the data the task just wrote. Since we were only saving the addon to trigger a re-index, this bypasses the save step and just calls the reindexing directly.
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
Issue is still reproducible in https://marketplace-dev.allizom.org/ on FF20 (Win 7)
Please see screencast http://screencast.com/t/eExbs7rEa
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
It looks like count caching now. If you re-visit the app you tested is it correct?  I just tested one on -dev and immediately after it said "0 reviews" but after about 1 minute it updated.

I can see if we can invalidate this somehow, but it's an improvement -- at least the data is correct in the database.
I'm stuck on this...

I can reproduce locally sometimes. The task is updating the total reviews field of the db fine and the .save() should invalidate the cached queries. But every so often it seems like the invalidation doesn't work and the cached query is returned with stale data.
I have re-visited the app and, on some apps it looked like it's a cache issue, but usually it reproduced the same as before fixing, even though I waited a certain amount of time, cleared cache or re-visited the page.
Target Milestone: 2012-11-29 → ---
Whiteboard: [uinits] → [ugh-caching] p=3
This is no longer a bug in Fireplace thanks to the use of ratings objects to get an actual count.
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
Verified as fixed in https://marketplace-dev.allizom.org/ on FF24 (Win 7).
Postfix screencast http://screencast.com/t/OkrihBOBL
Closing bug.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.