Closed Bug 1174931 Opened 11 years ago Closed 11 years ago

Sometimes, the same website gets listed multiple times.

Categories

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

x86
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

VERIFIED FIXED
2015-06-30

People

(Reporter: krupa.mozbugs, Assigned: mstriemer)

References

Details

(Whiteboard: [uiwanted][needsSTR])

Sometimes, the same website gets listed multiple times. Refreshing the page usually solves the problem. https://www.dropbox.com/s/z02xiy2y8xa0pzj/Screenshot%202015-06-15%2015.43.26.png?dl=0
STR: 1. Filter content to show only website 2. Click on the homepage 3. Click on Popular 4. Repeat Steps until you encounter the bug (took me 3-4 turns to hit the bug) screencast: http://screencast.com/t/Vb1Y3rOifsUu
Assignee: nobody → mpillard
Priority: -- → P2
this looks like a frontend bug, probably related to caching (either request caching, but I doubt it, or model caching ?) somehow.
Definitely related to model caching. When we go through models.js cast(), we need a unique key to store in the cache. Somehow the code is passing 'slug' here, there is no slug for websites, so it ends up being 'undefined', storing only one entry in the cache (Techcrunch is currently the last site in altdev's first popular page - that's why it's the one shown when this bug occurs).
The template does: {% defer (url=api_url, pluck='objects', as='app', paginate='.app-list', id='searchresults') %} Because of as='app', the builder code looks at model_prototypes['app'] in settings_app, finds that the key it's supposed to use for model caching is 'slug', and tries to use it, failing. Model caching is important (allows us to load the detail page when the user is coming from search results super quickly), but it was never designed with multi-types endpoints in mind... we do have some code in apps.js to transform websites, and it exposes a 'key' propriety that could work for us, but it's called too manually for each displayed item, and not automatically by the builder :(
Fixed in https://github.com/mozilla/zamboni/commit/c7701c895c0603233b5e25e85a6e7d8c2acbae83 (It's a hack, that breaks model caching, but it should be good enough for now)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2015-06-30
A similar issue is reproducing on MP-dev FF OS 2.1, 3.0 and FF41(Android 4.2.1): -> after performing a search or directly in categories page some websites are listed twice. Refreshing the page doesn't solve the problem. I've also cleared cache. Please see the screenshots: http://screencast.com/t/urGB0Ece (Ashes ID:a6d15 from FFOS 3.0) Don't know if my issue is really related to this one, but until further notice, I'll reopen this bug.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Giving to mark so that he can try the frontend approach.
Assignee: mpillard → mstriemer
Status: REOPENED → RESOLVED
Closed: 11 years ago → 11 years ago
Resolution: --- → FIXED
Verified as fixed on MP-dev FF OS 2.1(Flame). Closing bug.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.