addons-frontend
addons-frontend copied to clipboard
The addon abuse report form no longer displays a confirmation message for language tools and reports sent from mobile
Describe the problem and steps to reproduce it:
- Open an addon detail page on mobile
- Submit an abuse report
What happened?
There is no confirmation message displayed after the abuse report is sent; the textbox remains open
What did you expect to happen?
There should be a confirmation message displayed after the abuse report is sent
Anything else we should know?
- if I'm looking in admin abuse report, I can see that the report was sent - https://addons-internal.stage.mozaws.net/en-US/admin/models/abuse/abusereport/45680/change/
- I'm reproducing this only on -dev and stage
- @diox did some refactoring around abuse reports in https://github.com/mozilla/addons-server/pull/19504, so this could have caused this regression

Update: the issue can be reproduced on prod now as well with Firefox for android.
This does appear to be a regression from https://github.com/mozilla/addons-server/pull/19504, which I reviewed, so I guess I should have thought to check this. addons-frontend relies on there being a valid slug returned in the API response of /api/v5/abuse/report/addon/, which was happening before, but now the response just has slug: null.
@diox Is there a reason we must return null for the slug in this response? If we have just reported abuse for an add-on, we should be able to report back what the slug was, shouldn't we? This could be addressed in addons-frontend by relying on guid instead of slug, but, for the most part, we use slug for this type of thing in addons-frontend most of the time, so I'm not sure that changing addons-frontend is the best approach.
Also, we currently send the slug, not the guid to the abuse reporting API, which is why it makes sense to allow front-end to continue to use the slug from the response. We could change everything in front-end around abuse reporting to use the guid, if that's deemed a better approach.
Also, we currently send the
slug, not theguidto the abuse reporting API, which is why it makes sense to allow front-end to continue to use theslugfrom the response. We could change everything in front-end around abuse reporting to use theguid, if that's deemed a better approach.
https://github.com/mozilla/addons-server/blob/master/src/olympia/abuse/views.py#L62:L63 indicates accepting guid is for backwards compatibility too, i.e. really it's supposed to be a guid that's been submitted.
We no longer store a foreign key to the add-on and only store the guid internally, so we no longer had an Addon instance directly available, I figured it wasn't going to be a breaking change as the API already returned null in some cases. I didn't anticipate we'd rely on it as a confirmation the report went through.
We could return the slug again, but IMHO we shouldn't rely on this behavior, because we don't want to return the slug of a non-public add-on if a guid was used to look it up, so we'd need to ensure we only do this if the slug was originally used. That leaves an edge-case if you have left the abuse report page opened for a while and then the add-on got deleted/disabled, you'd see the same problem again as the API would no longer be able to return the slug in that case.
Going to fix that server-side in https://github.com/mozilla/addons-server/issues/19578 ; keeping this opened for now, we might want to stop relying on the presence of the slug in the response too if that's easy to do.
@AlexandraMoga @diox I reproduced this issue with a lang pack on FF103(Win10). I cannot detail it further because I hit a throttle after the 15th attempt and now I'm stuck for 1h+
Yes, I've noticed that the issue will reproduce with langpacks and dictionaries as well. Apparently, language tools are using the internal AMO report abuse form. For reference, language packs and dictionaries can't be reported from addons manager like extensions and themes can, so maybe there is a connection there.
@diox This is no longer reproducible on AMO dev and stage - FF103(Win10) and Fenix for Android.