| Summary: | Pages using ToasterTables break the back button | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] Toaster | Reporter: | Belen Barros Pena <belen.barros.pena> |
| Component: | toaster | Assignee: | Elliot Smith <elliot.smith> |
| Status: | VERIFIED FIXED | QA Contact: | Alexandru Roman <alexandru.costinx.roman> |
| Severity: | normal | ||
| Priority: | Medium | CC: | alexandru.costinx.roman, belen.barros.pena, elliot.smith, jessica.zhang, stanciux.mihail |
| Version: | 1.8 | ||
| Target Milestone: | 2.0 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
|
Description
Belen Barros Pena
2015-09-03 17:04:50 UTC
I think it's to do with the fact that if you request a page which requires URL parameters (page, orderby etc.) but don'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&page=1&orderby=name& 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'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'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's really a case of whether we want explicit URLs all the time (so that they always contain the parameters) or whether we're OK with implicit default parameters (which don'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'd probably go for 1 and 2 in combination (I don't have any issue with implicit default parameters which don't always show in the URL). 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. (In reply to comment #2) > 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. That branch seems to fix the problem everywhere except in one case. This is it: * Visit the layer details page * Select the 'Machines' (or 'Recipes') tab * Click the back button You stay in the same tab: clicking the back button removes the internal anchor in the url. I think this is a bootstrap issue, as bootstrap tab elements don'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). I should have mentioned, I'll do this in a separate branch (this is the only part of the back button problem which isn't down to caching, it seems). I'll leave the fix for the caching issue in elliot/toaster/bad_caching-7660. This problem is being further compounded by the RedirectException stuff I mentioned above, which breaks the history while you're trying to fix the interaction between Bootstrap tabs and the history. Also note that the page you mention as still being broken (layer details) isn't a ToasterTable: it's implemented via the layerdetails view in views.py. (In reply to comment #7) > Also note that the page you mention as still being broken (layer details) > isn't a ToasterTable: it's implemented via the layerdetails view in views.py. my bad: sorry. I thought the layer details page was also using ToasterTables. Submitted to mailing list for review: https://lists.yoctoproject.org/pipermail/toaster/2015-September/002740.html Note that http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=elliot/toaster/bad_caching-7660 also fixes this issue. Verified on master: fc45deac89ef63ca1c44e763c38ced7dfd72cbe1 |