mozilla / addons

☂ Umbrella repository for Mozilla Addons ✨
Other
123 stars 53 forks source link

Add-on count for a collection does not match results #6105

Closed kumar303 closed 5 years ago

kumar303 commented 5 years ago

Describe the problem and steps to reproduce it:

Fetch a collection:

curl 'https://addons-dev.allizom.org/api/v4/accounts/account/mozilla/collections/smarter-shopping/?lang=en-US&wrap_outgoing_links=true' | jq .
Results ``` { "id": 5496929, "uuid": "ede767c8-1583-4eb9-8d7d-9398d4d355f5", "url": "https://addons-dev.allizom.org/en-US/firefox/collections/mozilla/smarter-shopping/", "addon_count": 5, "author": { "id": 4757633, "name": "Mozilla", "url": "https://addons-dev.allizom.org/en-US/firefox/user/mozilla/", "username": "mozilla" }, "description": "Shopping", "modified": "2018-06-29T11:26:28Z", "name": "Smarter Shopping", "slug": "smarter-shopping", "public": true, "default_locale": "en-US" } ```

Fetch collection add-ons:

curl 'https://addons-dev.allizom.org/api/v4/accounts/account/mozilla/collections/smarter-shopping/addons/?page=1&sort=-added&lang=en-US&wrap_outgoing_links=true' | jq .
Results ``` { "page_size": 25, "page_count": 1, "count": 2, "next": null, "previous": null, "results": [ { "addon": { "id": 450612, "authors": [ { "id": 4679921, "name": "EDMONDYUEN", "url": "https://addons-dev.allizom.org/en-US/firefox/user/edmondyuen/", "username": "edmondyuen", "picture_url": null } ], "average_daily_users": 29, "categories": { "firefox": [ "nature" ] }, "contributions_url": null, "created": "2013-06-28T11:13:51Z", "current_version": { "id": 1468942, "compatibility": { "android": { "max": "9999", "min": "11.0" }, "firefox": { "max": "9999", "min": "4.0" } }, "edit_url": "https://addons-dev.allizom.org/en-US/developers/addon/texture/versions/1468942", "files": [], "is_strict_compatibility_enabled": false, "license": null, "release_notes": null, "reviewed": null, "url": "https://addons-dev.allizom.org/en-US/firefox/addon/texture/versions/0", "version": "0" }, "default_locale": "en-US", "description": null, "developer_comments": null, "edit_url": "https://addons-dev.allizom.org/en-US/developers/theme/texture/edit", "guid": null, "has_eula": false, "has_privacy_policy": false, "homepage": null, "icon_url": "https://addons-dev-cdn.allizom.org/user-media/addons/450612/icon.png?modified=59a9acb3", "icons": { "32": "https://addons-dev-cdn.allizom.org/user-media/addons/450612/icon.png?modified=59a9acb3", "64": "https://addons-dev-cdn.allizom.org/user-media/addons/450612/icon.png?modified=59a9acb3" }, "is_disabled": false, "is_experimental": false, "is_featured": false, "is_source_public": true, "last_updated": "2013-06-28T11:13:51Z", "name": "texture", "previews": [], "public_stats": false, "ratings": { "bayesian_average": 2.96893, "count": 1, "average": 5, "text_count": 1 }, "ratings_url": "https://addons-dev.allizom.org/en-US/firefox/addon/texture/reviews/", "requires_payment": false, "review_url": "https://addons-dev.allizom.org/en-US/reviewers/review/450612", "slug": "texture", "status": "public", "summary": null, "support_email": null, "support_url": null, "tags": [ "the texture used in ios 4-6" ], "theme_data": { "category": "Nature", "iconURL": "https://addons-dev-cdn.allizom.org/user-media/addons/450612/icon.png?modified=59a9acb3", "headerURL": "https://addons-dev-cdn.allizom.org/user-media/addons/450612/header.png?modified=59a9acb3", "name": "texture", "author": "EDMONDYUEN", "footer": "https://addons-dev-cdn.allizom.org/user-media/addons/450612/footer.png?modified=59a9acb3", "previewURL": "https://addons-dev-cdn.allizom.org/user-media/addons/450612/preview.png?modified=59a9acb3", "updateURL": "https://versioncheck-dev.allizom.org/en-US/themes/update-check/450612", "accentcolor": null, "header": "https://addons-dev-cdn.allizom.org/user-media/addons/450612/header.png?modified=59a9acb3", "version": "1.0", "footerURL": "https://addons-dev-cdn.allizom.org/user-media/addons/450612/footer.png?modified=59a9acb3", "detailURL": "https://addons-dev.allizom.org/en-US/firefox/addon/texture/", "textcolor": null, "id": "450612", "description": null }, "type": "persona", "url": "https://addons-dev.allizom.org/en-US/firefox/addon/texture/" }, "notes": null }, { "addon": { "id": 464482, "authors": [ { "id": 10279156, "name": "VitorNunes", "url": "https://addons-dev.allizom.org/en-US/firefox/user/XdsaoMaster/", "username": "XdsaoMaster", "picture_url": null } ], "average_daily_users": 6, "categories": { "firefox": [ "sports" ] }, "contributions_url": null, "created": "2013-09-18T19:28:52Z", "current_version": { "id": 1489172, "compatibility": { "android": { "max": "9999", "min": "11.0" }, "firefox": { "max": "9999", "min": "4.0" } }, "edit_url": "https://addons-dev.allizom.org/en-US/developers/addon/InternacionalRS/versions/1489172", "files": [], "is_strict_compatibility_enabled": false, "license": null, "release_notes": null, "reviewed": null, "url": "https://addons-dev.allizom.org/en-US/firefox/addon/InternacionalRS/versions/0", "version": "0" }, "default_locale": "en-US", "description": null, "developer_comments": null, "edit_url": "https://addons-dev.allizom.org/en-US/developers/theme/InternacionalRS/edit", "guid": null, "has_eula": false, "has_privacy_policy": false, "homepage": null, "icon_url": "https://addons-dev-cdn.allizom.org/user-media/addons/464482/icon.png?modified=cccf539c", "icons": { "32": "https://addons-dev-cdn.allizom.org/user-media/addons/464482/icon.png?modified=cccf539c", "64": "https://addons-dev-cdn.allizom.org/user-media/addons/464482/icon.png?modified=cccf539c" }, "is_disabled": false, "is_experimental": false, "is_featured": false, "is_source_public": true, "last_updated": "2013-09-18T19:28:52Z", "name": "Shopping?", "previews": [], "public_stats": false, "ratings": { "bayesian_average": 0, "count": 0, "average": 0, "text_count": 0 }, "ratings_url": "https://addons-dev.allizom.org/en-US/firefox/addon/InternacionalRS/reviews/", "requires_payment": false, "review_url": "https://addons-dev.allizom.org/en-US/reviewers/review/464482", "slug": "InternacionalRS", "status": "public", "summary": null, "support_email": null, "support_url": null, "tags": [ "inter", "internacional" ], "theme_data": { "category": "Sports", "iconURL": "https://addons-dev-cdn.allizom.org/user-media/addons/464482/icon.png?modified=cccf539c", "headerURL": "https://addons-dev-cdn.allizom.org/user-media/addons/464482/header.png?modified=cccf539c", "name": "Shopping?", "author": "VitorNunes", "footer": "https://addons-dev-cdn.allizom.org/user-media/addons/464482/footer.png?modified=cccf539c", "previewURL": "https://addons-dev-cdn.allizom.org/user-media/addons/464482/preview.png?modified=cccf539c", "updateURL": "https://versioncheck-dev.allizom.org/en-US/themes/update-check/464482", "accentcolor": "#b00a0a", "header": "https://addons-dev-cdn.allizom.org/user-media/addons/464482/header.png?modified=cccf539c", "version": "1.0", "footerURL": "https://addons-dev-cdn.allizom.org/user-media/addons/464482/footer.png?modified=cccf539c", "detailURL": "https://addons-dev.allizom.org/en-US/firefox/addon/InternacionalRS/", "textcolor": "#f7f7f7", "id": "464482", "description": null }, "type": "persona", "url": "https://addons-dev.allizom.org/en-US/firefox/addon/InternacionalRS/" }, "notes": null } ] } ```

What happened?

When fetching the collection, addon_count is 5. When fetching results, the count is 2 (and it only returns two results).

What did you expect to happen?

The counts should match.

Anything else we should know?

(Please include a link to the page, screenshots and any relevant files.)

See https://github.com/mozilla/addons/issues/12555

diox commented 5 years ago

This is a duplicate of mozilla/addons#5442 ; we know the cause, it's probably https://github.com/mozilla/addons/issues/4882, but haven't found what's causing it yet. Closing as dupe of mozilla/addons#5442.