<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>8252</bug_id>
          
          <creation_ts>2015-09-03 17:04:50 +0000</creation_ts>
          <short_desc>Pages using ToasterTables break the back button</short_desc>
          <delta_ts>2015-11-03 16:11:10 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Toaster</product>
          <component>toaster</component>
          <version>1.8</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Belen Barros Pena">belen.barros.pena</reporter>
          <assigned_to name="Elliot Smith">elliot.smith</assigned_to>
          <cc>alexandru.costinx.roman</cc>
    
    <cc>belen.barros.pena</cc>
    
    <cc>elliot.smith</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>stanciux.mihail</cc>
          
          <qa_contact name="Alexandru Roman">alexandru.costinx.roman</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>53710</commentid>
    <comment_count>0</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-09-03 17:04:50 +0000</bug_when>
    <thetext>Found in master:bc6a1a23e3d1af3861288a7abdbc9d5010470204

To reproduce, visit any of the following pages in Toaster:

* Compatible layers
* Compatible targets
* Compatible machines
* Layer details

Then click the back button: that removes the parameters in the URL, but does not bring you to the previous page.

The above pages happen to be the ones using ToasterTables, but I don&apos;t know if the problem is connected to that or to something else.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53739</commentid>
    <comment_count>1</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-09-04 10:38:43 +0000</bug_when>
    <thetext>I think it&apos;s to do with the fact that if you request a page which requires URL parameters (page, orderby etc.) but don&apos;t provide those parameters, Toaster adds them to the URL, then redirects you to that URL instead.

This means that if you are at

  /project/2/

and follow the machines link, which points at

  /project/2/machines/

you actually end up at

  /project/2/machines/?limit=25&amp;page=1&amp;orderby=name&amp;

So then you have to use the back button twice to get back to /project/2/ (once to get back to /project/2/machines, then again to get back to /project/2/).

I guess that we need to maintain limit, page, orderby etc. for each table separately (some orderby fields won&apos;t apply to all tables, for example). We could do this several ways:

1. We add the params to all of the URLs when they are constructed.

2. We set some defaults which don&apos;t show in the URL, but which can be overridden by the user (and will then show up in the URL). NB This can be combined with option 1. It&apos;s really a case of whether we want explicit URLs all the time (so that they always contain the parameters) or whether we&apos;re OK with implicit default parameters (which don&apos;t necessarily show in the URL).

3. We rewrite the URL in place to add the parameters, without using a redirect, via the history API. This seems unnecessarily fiddly though and is probably better suited to single-page apps.

I would have to try each to see which worked best in our context, but I&apos;d probably go for 1 and 2 in combination (I don&apos;t have any issue with implicit default parameters which don&apos;t always show in the URL).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54136</commentid>
    <comment_count>2</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-09-16 07:27:28 +0000</bug_when>
    <thetext>I think this is fixed in elliot/toaster/bad_caching-7660, as it has the same root cause as https://bugzilla.yoctoproject.org/show_bug.cgi?id=7660.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54145</commentid>
    <comment_count>3</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-09-16 09:50:34 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; I think this is fixed in elliot/toaster/bad_caching-7660, as it has the same
&gt; root cause as https://bugzilla.yoctoproject.org/show_bug.cgi?id=7660.

That branch seems to fix the problem everywhere except in one case. This is it:

* Visit the layer details page
* Select the &apos;Machines&apos; (or &apos;Recipes&apos;) tab
* Click the back button

You stay in the same tab: clicking the back button removes the internal anchor in the url.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54147</commentid>
    <comment_count>4</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-09-16 10:34:40 +0000</bug_when>
    <thetext>I think this is a bootstrap issue, as bootstrap tab elements don&apos;t support the back button. I think I can fix it via the history API though (e.g. see http://www.redotheweb.com/2012/05/17/enable-back-button-handling-with-twitter-bootstrap-tabs-plugin.html, https://gist.github.com/josheinstein/5586469).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54148</commentid>
    <comment_count>5</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-09-16 10:36:03 +0000</bug_when>
    <thetext>I should have mentioned, I&apos;ll do this in a separate branch (this is the only part of the back button problem which isn&apos;t down to caching, it seems). I&apos;ll leave the fix for the caching issue in elliot/toaster/bad_caching-7660.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54151</commentid>
    <comment_count>6</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-09-16 11:24:28 +0000</bug_when>
    <thetext>This problem is being further compounded by the RedirectException stuff I mentioned above, which breaks the history while you&apos;re trying to fix the interaction between Bootstrap tabs and the history.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54153</commentid>
    <comment_count>7</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-09-16 11:27:42 +0000</bug_when>
    <thetext>Also note that the page you mention as still being broken (layer details) isn&apos;t a ToasterTable: it&apos;s implemented via the layerdetails view in views.py.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54154</commentid>
    <comment_count>8</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-09-16 11:38:02 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; Also note that the page you mention as still being broken (layer details)
&gt; isn&apos;t a ToasterTable: it&apos;s implemented via the layerdetails view in views.py.

my bad: sorry. I thought the layer details page was also using ToasterTables.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54418</commentid>
    <comment_count>9</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-09-22 07:28:17 +0000</bug_when>
    <thetext>Submitted to mailing list for review: https://lists.yoctoproject.org/pipermail/toaster/2015-September/002740.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54419</commentid>
    <comment_count>10</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2015-09-22 07:28:56 +0000</bug_when>
    <thetext>Note that http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=elliot/toaster/bad_caching-7660 also fixes this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56146</commentid>
    <comment_count>11</comment_count>
    <who name="Alexandru Roman">alexandru.costinx.roman</who>
    <bug_when>2015-11-03 16:11:10 +0000</bug_when>
    <thetext>Verified on master: fc45deac89ef63ca1c44e763c38ced7dfd72cbe1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>