-6

Clicking on "run query" for a cached query before the cached results appear on the screen returns a JSON object instead of the query results. Example:

enter image description here

{
  "running": true,
  "job_id": "76ba1e4f-0625-45a8-93fa-e28ed481c528"
}

Since folks seem to be struggling reproducing this and clicking Run Query reasonably quickly, here is a screen recording showing the issue:

enter image description here

It can be more easily reproduced if your Internet connection is slow, such as if you're on a DSL or 3G network.

I ran into this issue well over a hundred times and I wasn't trying to click fast or push the system. Sometimes the cached results take a few seconds to load.

17
  • 1
    @Lino any query that is cached and when clicking fast enough. a gif would be useful to show that but GIF size limit is extremely small and easy to hit; increase it to allow for more practical uploads Commented Nov 7 at 21:02
  • 7
    @FranckDernoncourt, do you have any console errors or user scripts? It's not happening to me when I run this query
    – KyleMit StaffMod
    Commented Nov 7 at 21:05
  • 1
    @KyleMit I was using my phone for the screenshot so no user scripts there. I repro on Windows with Chrome (incognito), nothing in the console: i.sstatic.net/rSDOiNkZ.png Commented Nov 7 at 21:48
  • @KyleMit that'll be easier to repro with a query with a long output, since need to click "run query" before the cached result appear on screen. And/or you can throttle the internet connection. Commented Nov 7 at 21:55
  • 3
    The button gets disabled (in the HTML) when you click on it, so it doesn't matter how fast I click, nothing strange happens.
    – Glorfindel Mod
    Commented Nov 8 at 8:18
  • @Glorfindel only need to click one time on it. The bug only affects cached queries Commented Nov 8 at 10:30
  • I might have arthritis because I seem to be too slow. :) Maybe it's then not a very bad bug because simply waiting a bit bypasses it Commented Nov 8 at 18:39
  • @NoDataDumpNoContribution I typically run across this issue when the cached results are slow to load. Commented Nov 8 at 19:31
  • 8
    This has nothing todo with the result being cached or not. What you're seeing is caused by the javascript in query.js, specially the DataStackExchange.ready event, not having run yet. Until that ready event is executed the Run button is a plain form submit (the action attribute on the form points to it) to the query controller run endpoint and that endpoint only returns json to be processed by javascript. Conditions between your browser and data.se might cause slow resolving, loading and executing javascript, at least slower then your fabulous reaction time. status-bydesign
    – rene Mod
    Commented Nov 10 at 7:10
  • @rene "that endpoint only returns json to be processed by javascript" why is that by design? That's very poor UX. btw why not post as an answer? Commented Nov 10 at 7:38
  • 2
    It is by-design because that is how it has been since 2010-ish and has worked 99,99999% of the time. The site needs javascript to work, it doesn't have a fallback for proper operation without javascript. Maybe the submit button should start out disabled and only be enabled when DataStackExchnage.ready runs but then again if time is spent it might be better spent on solving issues that are beneficial to more general use, not edge cases.
    – rene Mod
    Commented Nov 10 at 7:47
  • 1
    @rene ok that's a [status-declined] then. Anyway can you post as an answer? The question is obviously clear. Commented Nov 10 at 7:49
  • 5
    @rene It's very far from a rare edge case for users with slow Internet connections. I was able to reproduce the issue consistently on the first query in the above comment with example queries by throttling my Internet connection to 1 Mbps. Commented Nov 10 at 10:05
  • 1
    @SonictheAnonymousHedgehog sure, anyone that wants to spend time on it can suggest a fix. Not sure who merges these PRs nowadays.
    – rene Mod
    Commented Nov 10 at 14:56

1 Answer 1

2

It's by-design for the following reason:

It is by-design because that is how it has been since 2010-ish and has worked 99,99999% of the time. The site needs javascript to work, it doesn't have a fallback for proper operation without javascript. Maybe the submit button should start out disabled and only be enabled when DataStackExchnage.ready runs but then again if time is spent it might be better spent on solving issues that are beneficial to more general use, not edge cases.

– rene

The same user gives some additional information about the root of the issue:

This has nothing todo with the result being cached or not. What you're seeing is caused by the javascript in query.js, specially the DataStackExchange.ready event, not having run yet. Until that ready event is executed the Run button is a plain form submit (the action attribute on the form points to it) to the query controller run endpoint and that endpoint only returns json to be processed by javascript. Conditions between your browser and data.se might cause slow resolving, loading and executing javascript

1
  • 6
    For any curious folks: This answer was undeleted by normal users after I deleted it, which is a reported bug. That said, this now constitutes an answer and I'm perfectly fine with it being undeleted.
    – Spevacus Mod
    Commented Nov 10 at 18:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .