Page MenuHomePhabricator

WDQS GUI should not remember column sort orderings from previous queries or previous runs
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Run a SPARQL query that includes an ORDER BY clause to explicitly order its results, eg https://w.wiki/6DJj
  • Use the GUI to change the order, by clicking one of the ^v buttons on one of the columns
  • Re-run the SPARQL query (even in a different window)

What happens?:

  • The re-run query returns rows in the order last set using the GUI, not the order specified in the query

What should have happened instead?:

  • The re-run query should return results as specified by the ORDER BY clause in the query

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

I am seeing this on Chrome version 109.0.5414.74 on Windows 10. It seems to be a recent reversion -- I wasn't aware of it before January 11.
I raised it at WD:RAQ and also on the wikidata Telegram channel; in both forums other users also report seeing this.

  • UI may also be remembering which page of a multi-page result set one had browsed to.

Can be very annoying, if one is trying to debug a complex query, or share an intricate search order -- and finding oneself unexpectedly on a later page of results can make things even more confusing. First principle of least surprise is the GUI should return results in the order they have been asked for.

  • The behaviour persists even if it is several days since the query last ran; and also even if minor changes are made to the query text, eg by adding spaces -- so can't be a url caching issue.

Acceptance Criteria

  • The columns are not sorted as they were in the previous time the query was run

Event Timeline

@Lucas_Werkmeister_WMDE said this might have been be introduced with the recent Bootstrap version update.

I have observed this happening for a few weeks, did not know it was a bug.

Seems to be a change in bootstrap-table 1.21.2, in 1.21.1 the issue isn’t reproducible.

Apparently we’re using the bootstrap-table cookie extension, but it’s only supposed to save the bs.table.pageList, whatever that means…

TableResultBrowser.js
cookie: true,
cookieIdTable: '1',
cookieExpire: '1y',
cookiesEnabled: [ 'bs.table.pageList' ],

We should check if this is a regression in bootstrap-table or if we’re doing something wrong, and what the pageList thing even is (maybe we can just get rid of the whole cookie extension). In the meantime, I think we can safely revert to the previous version of the library.

Change 879995 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[wikidata/query/gui@master] Revert "Bump bootstrap-table from 1.21.1 to 1.21.2"

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

Change 879995 merged by jenkins-bot:

[wikidata/query/gui@master] Revert "Bump bootstrap-table from 1.21.1 to 1.21.2"

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

Change 880489 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: WDQSGuiBuilder):

[wikidata/query/gui-deploy@production] Merging from 448b9571568e174977d32ca4ce0a499e9fb6ac6b

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

Change 880489 merged by Lucas Werkmeister (WMDE):

[wikidata/query/gui-deploy@production] Merging from 448b9571568e174977d32ca4ce0a499e9fb6ac6b

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

Should be fixed for now; but we don’t want to stay on the outdated bootstrap-table version forever, so it’s still good that this is in the Wikidata Dev Team backlog.

Arian_Bozorg claimed this task.
Arian_Bozorg updated the task description. (Show Details)