Page MenuHomePhabricator

Render partial results
Open, Needs TriagePublic

Description

When a query times out, the query service sometimes sends a partial, truncated response, like this:

{
  "head" : {
    "vars" : [ "item", "itemLabel" ]
  },
  "results" : {
    "bindings" : [ {
      "item" : {
        "type" : "uri",
        "value" : "http://www.wikidata.org/entity/Q25471040"
      },
      "itemLabel" : {
        "xml:lang" : "en",
        "type" : "literal",
        "value" : "Pixel"
      }
    }, {
      "item" : {
        "type" : "uri",
        "value" : "http://www.wikiERROR query=…
Stacktrace: …

Instead of dumping the entire response into the result view (where it may even crash the browser), we should try to render it. This should work:

  • Find the breaking point between partial results and error message
  • Remove lines from the end until a line }, { is found
  • Remove the , {
  • Add } }
  • Parse and display (with warning that the results are incomplete)