mozilla / addons

☂ Umbrella repository for Mozilla Addons ✨
Other
125 stars 41 forks source link

Add-on review submission is blocked with a "...can't leave more than one review for the same add-on..." message #10228

Closed ValentinaPC closed 7 years ago

ValentinaPC commented 7 years ago

Steps to reproduce:

  1. Load AMO-dev details page for an add-on that wasn't yet reviewed by you (on your device)
  2. Tap some review stars but change you mind by clicking outside the review submission popup
  3. Refresh the page
  4. Try to add a review for the same add-on

Expected results: Review submission popup is displayed.

Actual results: A message saying that you cannot add 2 reviews for the same add-on is displayed.

Notes/Issues:

Verified on AMO-dev FF51(Android 6.0.1). Issue is reproducing on -dev and -stage. Video for this issue: videotogif_2017 03 08_18 07 04

kumar303 commented 7 years ago

I can't reproduce this. When I refresh the page, the saved star rating is there. Can you reproduce it every time? Could you attach a console log when it happens?

ValentinaPC commented 7 years ago

I can reproduce this every time on device or "mobile view" for desktop. Please see the screenshot for the logs: 2017-03-09_1022

kumar303 commented 7 years ago

Thanks for the console log, that's helpful. It looks like some kind of API call is failing but I can't find the error in our server logs.

Does this happen for every add-on? Can you provide an example of an add-on it happens for on dev?

Also, your STR doesn't mention how you first logged in. Did you do it with the 'log in to rate this add-on' or before?

ValentinaPC commented 7 years ago

Also, your STR doesn't mention how you first logged in. Did you do it with the 'log in to rate this add-on' or before?

I was already logged. Login was made normally, from "Log in /Sign up" button.

Does this happen for every add-on? Can you provide an example of an add-on it happens for on dev?

You must use and add-on you did not reviewed before. It must be your first time. And it is mandatory to refresh the page after dismissing first attempt to review. (as in step 3) Happens for me for any add-on.

Examples of add-ons:

You can try on desktop too, while being in "View Mobile Site" mode.

kumar303 commented 7 years ago

Thanks! I can reproduce it now.

kumar303 commented 7 years ago

A note for myself: it makes no difference if you enter review text or not before hitting refresh. The stars are not saved either way.

kumar303 commented 7 years ago

Root cause: https://github.com/mozilla/addons/issues/4180

diox commented 7 years ago

@kumar303 I merged my workaround for https://github.com/mozilla/addons-server/issues/5072, adding version filtering. So, when you're trying to find out if the user has already posted a review on the current addon (and only that - don't change anything to the call fetching the list of reviews to the add-on), you should filter on user, addon and version (using the id of the current version of the addon) at the same time.

Note that this will effectively allow the user to post a new review if the addon current version changed since they posted a review in the past. This is fine and expected to be possible.

Docs are now updated: http://addons-server.readthedocs.io/en/latest/topics/api/reviews.html

ValentinaPC commented 7 years ago

Verified this on FF53(Android 6.0.1) for add-ons and themes.

Also, the review is recorded on desktop, even if reviews without a text body cannot be submitted directly on desktop. Please check this example: https://addons-dev.allizom.org/en-US/android/addon/lock/reviews/ on desktop and Android.

kumar303 commented 7 years ago

number of reviews is incremented - expected?

Yes because when you select a star it technically records a review, just one without any text

no review in "All written reviews" page

I'm not sure what you mean. Could you clarify the exact steps and what the expectation was? If you don't submit any text then it shouldn't show up in All written reviews. If you think it's a bug, could you file a new one?

ValentinaPC commented 7 years ago

I'm not sure what you mean. Could you clarify the exact steps and what the expectation was? If you don't submit any text then it shouldn't show up in All written reviews. If you think it's a bug, could you file a new one?

I'm not sure it is, but, I think, same behavior should apply in both mobile and desktop site.

While, not entering a review on device, but the rating stars, two things are happening:

ValentinaPC commented 7 years ago

We can mark this as verified fixed, while the initial issue was fixed. I've logged a separate bug regarding the review dismissal issue.

kumar303 commented 7 years ago

on device the number of reviews, under the ratings stars, is incremented, even if the review process was dismissed

Ah, good catch. This is a known bug and will be fixed in https://github.com/mozilla/addons/issues/10358

on desktop, the review is recorded, containing only the rating stars.

This should have been fixed in https://github.com/mozilla/addons/issues/4164 -- I don't know if that fix has fully landed everywhere yet.

ValentinaPC commented 7 years ago

This should have been fixed in mozilla/addons#4164 -- I don't know if that fix has fully landed everywhere yet.

It has landed on AMO-dev, so we are good. Thanks for you reply!