kkhatua opened a new pull request #1787: DRILL-7203: Back button not working 
URL: https://github.com/apache/drill/pull/1787
 
 
   The root cause of this bug is that when a form is submitted, Drill uses the 
POST mechanism via an AJAX call. The response is then used to swap the existing 
`/query` page's DOM. This means that the browser history does not capture the 
change because the URL has never changed. As a result, when the user hits the 
`[BACK]` button, the call is made to the browser which redirects to the last 
page visited just before `/query`. 
   Changing the AJAX call mechanism is risky, so the workaround was to leverage 
the `sessionStorage` feature supported by most modern (and secure) browsers. 
When a query is submitted, `sessionStorage`  is used to cache the submitted 
query (like a session/cookie). If the back button on the page is hit, an 
additional flag is set, telling the Javascript to revisit the submission page 
and use the _cached_ query. If the submission page is revisited via any other 
mechanism, it is assumed that the `[BACK]` button was not pressed (since the 
additional flag is not set), and the cached query is cleared from the browser 
memory.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to