Page MenuHomePhabricator

Gather frontend should make sure list sorting does not depend on the browser's JSON property iteration order
Closed, DeclinedPublic

Description

Compare http://en.wikipedia.org/w/api.php?action=query&format=jsonfm&generator=listpages&glspid=13 and

$.get( 'https://en.wikipedia.org/w/api.php?action=query&format=json&generator=listpages&glspid=13' ).then( function( data ) {
    for ( i in data.query.pages ) {
        console.log( i, data.query.pages[i] );
    }
} );

The first will order results by title. On Chrome, the second will order results by page id. This is due to Chrome's technically valid but annoying behavior of rearranging numeric JSON keys. Clients should ensure they do not depend on the browser's iteration order; this can be done by asking for and iterating the indexpageids parameter.

Noticed in the generator=listpages API calls, but any call using title parameter or a generator might be affected.

Event Timeline

Tgr created this task.May 6 2015, 7:10 PM
Tgr raised the priority of this task from to Needs Triage.
Tgr updated the task description. (Show Details)
Tgr added a project: Gather.
Tgr added a subscriber: Tgr.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 6 2015, 7:10 PM
Jdlrobson moved this task from Needs triage to Should haves on the Gather board.May 7 2015, 4:23 PM
Jdlrobson moved this task from Some day to Developer backlog on the Gather board.Jul 6 2015, 6:17 PM
Jdlrobson moved this task from Developer backlog to Sub tasks on the Gather board.
KLans_WMF triaged this task as Low priority.Sep 16 2015, 5:15 PM
MBinder_WMF closed this task as Declined.Jun 1 2016, 9:59 PM
MBinder_WMF added a subscriber: MBinder_WMF.

This task was declined as part of a batch-decline related to sunsetting the Gather project. Please ping (politely) if this task should be reopened. For more information, you can also see here: https://www.mediawiki.org/wiki/Extension:Gather