Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ratings API returns URLs depending in app parameter, but this isn't documented #1910

Closed
diox opened this issue Nov 28, 2022 · 2 comments · Fixed by mozilla/addons-server#22648
Assignees
Labels
qa:not_needed repository:addons-server Issue relating to addons-server
Milestone

Comments

@diox
Copy link
Member

diox commented Nov 28, 2022

The Ratings detail/list API aren't documented as accepting the app parameter. But because they return URLs to user profiles (user.url), and user profiles URLs do depend on an app, it uses the app parameter if present, falling back to User-Agent if not.

Since user profiles do have links to add-ons, we likely want to keep that behavior and:

  1. Document it
  2. Modify add-ons frontend to pass the current app to ratings API calls - because otherwise we're using User-Agent, despite it not being part of the cache key for the API, resulting in random behavior.

Example (see the user.url properties, which will differ depending on whether or not you add the app parameter, what your User-Agent is, and whether or not this is served from CDN cache):
https://addons-dev.allizom.org/api/v5/ratings/rating/?addon=awesome-screenshot-plus-&page=1&lang=en-US

┆Issue is synchronized with this Jira Task

@diox
Copy link
Member Author

diox commented Dec 2, 2022

Modify add-ons frontend to pass the current app to ratings API calls - because otherwise we're using User-Agent, despite it not being part of the cache key for the API, resulting in random behavior.

Not such a big deal, because we only show the URL to the user profile if the page is being viewed by someone with Users:Edit permission (this is because most users don't have a user profile page nowadays). Still, filed #2181 for that part

@KevinMind
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qa:not_needed repository:addons-server Issue relating to addons-server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants