Page MenuHomePhabricator

Bug: Lazy loaded references do not load on certain pages
Closed, ResolvedPublic3 Estimated Story Points

Description

The problem seems to be that Skin.js expects the API to return a list of subsections but interestingly the API returns the top most section that contains references.

Compare the response of a request with prop seections compared to one without.

I'm not sure if this is a feature or bug, but there are 2 courses of action here:
1) We keep the existing response, but replace gateway.getReferencesLists with gateway.getReferenceSections and simplify Skin.lazyLoadReferences to simply replace the content block of the entire section with the HTML from the response.
2) We fix the API to send parent sections and keep the status quo.

Personally I'm in a favor of #1. It leads to the cleanest frontend code. [JR: all lies]

Event Timeline

@ovasileva suggested priority high since the reading of the reference section is currently broken in beta.

ovasileva raised the priority of this task from Medium to High.Sep 26 2016, 11:40 AM
jhobs renamed this task from Bug:: Lazy loaded references do not load on certain pages to Bug: Lazy loaded references do not load on certain pages.Nov 21 2016, 5:34 PM

We punted this due to the fact that deployments are not possible right now. When they are let's SWAT a config change to disable this and explore T146396.

ovasileva set the point value for this task to 3.Nov 29 2016, 5:18 PM

There is something really weird going on here. The API behaviour is different for me locally and I'm struggling to get to the bottom of it. I'll try and get a minimum test case...

W00t minimum test case - https://en.m.wikipedia.beta.wmflabs.org/wiki/T146394
Seems to break the mobileview api's behaviour.

I got sucked into refactoring the API to make sense of what's happening here:

After a little investigating it does look like the error is probably on the client and the information in the description of this bug is inaccurate.
The method getSectionId inside skin when run on $( '.mf-lazy-references-placeholder' )[0] returns Notes_and_references ... not Notes.

Change 327137 had a related patch set uploaded (by Jdlrobson):
Test and correct behaviour of getSectionId

https://gerrit.wikimedia.org/r/327137

To test behaviour please try https://en.m.wikipedia.beta.wmflabs.org/wiki/T146394 before and after. I've simplified the wikitext so it doesn't need any templates.

Jdlrobson updated the task description. (Show Details)

Change 327137 merged by jenkins-bot:
Test and correct behaviour of getSectionId

https://gerrit.wikimedia.org/r/327137

Both @Jdlrobson's minimal test case and various other well-referenced articles (Claude Monet, Barack Obama, Impressionism, Black-figure Pottery, Francisco Goya… – guess who's been using Related Articles?) work as expected.