Prevent stale data in ToasterTables
cover Prevent stale data in ToasterTables
Prevent incorrect caching of ToasterTable data so it doesn't go stale as the user navigates browser history with back/forward.
Changes since 75bad1b64bd485a50af69ed1f8663a0dadbb5f9e are in:git://git.yoctoproject.org/poky-contrib, elliot/toaster/bad_caching-7660
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=elliot/toaster/bad_caching-7660
Related bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7660
I haven't tested every permutation of table navigation with this patch, but issue 7660 is fixed.
NB Bug 8294 (https://bugzilla.yoctoproject.org/show_bug.cgi?id=8294)
causes incorrect data to display in a similar way, but the root cause seems to be different (it's due to incorrect context update there, rather than caching). This patch doesn't fix that.
Elliot Smith (2):
toaster: Don't add new history entries when table data loads
toaster: Don't HTTP cache ToasterTable responses
bitbake/lib/toaster/toastergui/static/js/table.js | 2 +- bitbake/lib/toaster/toastergui/widgets.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)
--
Elliot Smith
Software Engineer
Intel OTC
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH 1/2 toaster: Don't add new history entries when table data loads
When ToasterTable data is loaded into the UI, a new entry is added to the browser history. This means that pressing the back button appears to have no effect, as you end up at the same page, possibly with slightly different data.
Instead, use replaceState(), so that the browser history doesn't grow, but the page context still gets updated.
[YOCTO #7660]
--- bitbake/lib/toaster/toastergui/static/js/table.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/toaster/toastergui/static/js/table.js +1 -1
@@ -49,7 +49,7 @@ function tableInit(ctx){ headers: { 'X-CSRFToken' : $.cookie('csrftoken')}, success: function(tableData) { updateTable(tableData); - window.history.pushState({ + window.history.replaceState({ tableData: tableData, tableParams: tableParams }, null, libtoaster.dumpsUrlParams(tableParams));
Signature · 14 lines
Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Re: [review-request][PATCH 1/2] toaster: Don't add new history entries when table data loads
Quoted 20 lines · Elliot Smith
When ToasterTable data is loaded into the UI, a new entry is added to the browser history. This means that pressing the back button appears to have no effect, as you end up at the same page, possibly with slightly different data.
Instead, use
replaceState(), so that the browser history doesn't grow, but the page context still gets updated.[YOCTO #7660]
Signed-off-by Elliot Smith <[email protected]>--- bitbake/lib/toaster/toastergui/static/js/table.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)bitbake/lib/toaster/toastergui/static/js/table.js +0
-0
bitbake/lib/toaster/toastergui/static/js/table.js function tableInit(ctx){ · line 55
Quoted 8 lines
bitbake/lib/toaster/toastergui/static/js/table.js +1
-1@@ -49,7 +49,7 @@ function tableInit(ctx){ headers: { 'X-CSRFToken' : $.cookie('csrftoken')}, success: function(tableData) { updateTable(tableData); - window.history.pushState({ + window.history.replaceState({ tableData: tableData, tableParams: tableParams }, null, libtoaster.dumpsUrlParams(tableParams));
If we replace state each time we load, we won't have a back stack to put the tableData into and subsequently pop it out of on the onpopstate event, could you also remove storing the tableData, tableParams in the browser and remove the window.onpopstate handler code as that won't ever fire now.
Thanks,
Michael
Re: [review-request][PATCH 1/2] toaster: Don't add new history entries when table data loads
Quoted 29 lines · Michael Wood
Quoted 27 lines · Elliot Smith
When ToasterTable data is loaded into the UI, a new entry is added to the browser history. This means that pressing the back button appears to have no effect, as you end up at the same page, possibly with slightly different data.
Instead, use
replaceState(), so that the browser history doesn't grow, but the page context still gets updated.[YOCTO #7660]
Signed-off-by Elliot Smith <[email protected]>--- bitbake/lib/toaster/toastergui/static/js/table.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)bitbake/lib/toaster/toastergui/static/js/table.js +1
-1@@ -49,7 +49,7 @@ function tableInit(ctx){ headers: { 'X-CSRFToken' : $.cookie('csrftoken')}, success: function(tableData) { updateTable(tableData); - window.history.pushState({ + window.history.replaceState({ tableData: tableData,
Quoted 9 lines
bitbake/lib/toaster/toastergui/static/js/table.js function tableInit(ctx){ · line 55
Quoted 3 lines
bitbake/lib/toaster/toastergui/static/js/table.js +0
-0tableParams: tableParams }, null, libtoaster.dumpsUrlParams(tableParams));If we replace state each time we load, we won't have a back stack to put the tableData into and subsequently pop it out of on the onpopstate event, could you also remove storing the tableData, tableParams in the browser and remove the window.onpopstate handler code as that won't ever fire now.
Thanks for the review.
I've added a commit which (I think) removes the code you're talking about. It's 0ea00338f688d4b90ab5794cd2bbb181db880d10 on
the elliot/toaster/bad_caching-7660 branch. Could you please verify that I've understood your comment correctly? If I have, I'll resubmit the patches.
Thanks.
Elliot
Signature · 3 lines
Elliot Smith Software Engineer Intel Open Source Technology Centre
Re: [review-request][PATCH 1/2] toaster: Don't add new history entries when table data loads
Quoted 43 lines · Elliot
On 29 September 2015 at 18:50, Michael Wood <[email protected] <mailto:[email protected]>> wrote:
On 14/09/15 16:09, Elliot Smith wrote:
When ToasterTable data is loaded into the UI, a new entry is added to the browser history. This means that pressing the back button appears to have no effect, as you end up at the same page, possibly with slightly different data.
Instead, use
replaceState(), so that the browser history doesn't grow, but the page context still gets updated.[YOCTO #7660]
Signed-off-by Elliot Smith <[email protected]<mailto:[email protected]>>
---
bitbake/lib/toaster/toastergui/static/js/table.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js index f18034d..99b99a0 100644
--- a/bitbake/lib/toaster/toastergui/static/js/table.js +++ b/bitbake/lib/toaster/toastergui/static/js/table.js @@ -49,7 +49,7 @@ function tableInit(ctx){
headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
success: function(tableData) {
updateTable(tableData);
- window.history.pushState({
+ window.history.replaceState({
tableData: tableData,
tableParams: tableParams
}, null,libtoaster.dumpsUrlParams(tableParams));If we replace state each time we load, we won't have a back stack to put the tableData into and subsequently pop it out of on the onpopstate event, could you also remove storing the tableData, tableParams in the browser and remove the window.onpopstate handler code as that won't ever fire now.
Quoted 22 lines
Thanks for the review.
I've added a commit which (I think) removes the code you're talking about. It's
0ea00338f688d4b90ab5794cd2bbb181db880d10on the elliot/toaster/bad_caching-7660 branch. Could you please verify that I've understood your comment correctly? If I have, I'll resubmit the patches.Thanks.
ElliotSignature · 14 lines
Elliot Smith Software Engineer Intel Open Source Technology Centre --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Thanks.
Patches submitted upstream, with a minor fix to keeping the update of the url parameters in the replaceState.
Michael
PATCH 2/2 toaster: Don't HTTP cache ToasterTable responses
In reply to Elliot SmithDjango allows generated pages to be cached by default by the browser. This can result in stale data displaying for some pages.
Instead, disable HTTP caching of ToasterTable responses, so that each time a ToasterTable view is displayed, its data is refreshed. This carries a performance penalty, but ensures that ToasterTable views (e.g. compatible layers) are correctly refreshed if the user navigates their history with forward/back.
[YOCTO #7660]
--- bitbake/lib/toaster/toastergui/widgets.py | 5 +++++ 1 file changed, 5 insertions(+)
bitbake/lib/toaster/toastergui/widgets.py +5 -0
@@ -20,6 +20,7 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. from django.views.generic import View, TemplateView +from django.views.decorators.cache import cache_control from django.shortcuts import HttpResponse from django.http import HttpResponseBadRequest from django.core import serializers
@@ -61,6 +62,10 @@ class ToasterTable(TemplateView): orderable=True, field_name="id") + # prevent HTTP caching of table data + @cache_control(must_revalidate=True, max_age=0, no_store=True, no_cache=True) + def dispatch(self, *args, **kwargs): + return super(ToasterTable, self).dispatch(*args, **kwargs) def get(self, request, *args, **kwargs): if request.GET.get('format', None) == 'json':
Signature · 14 lines
Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH 1/1 toaster: layerdetails Fix back button tab behaviour
This completes the behaviour fix of the back button in the layerdetails page as we not only have parameters in our history we also have the hash to indicate which tab is active. As we pop our history we need to show the corresponding tab.
[YOCTO #8252]
--- .../toaster/toastergui/static/js/layerdetails.js | 28 ++++++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-)
bitbake/lib/toaster/toastergui/static/js/layerdetails.js +23 -5
@@ -7,6 +7,9 @@ function layerDetailsPageInit (ctx) { var layerDepsList = $("#layer-deps-list"); var currentLayerDepSelection; var addRmLayerBtn = $("#add-remove-layer-btn"); + var targetTab = $("#targets-tab"); + var machineTab = $("#machines-tab"); + var detailsTab = $("#details-tab"); /* setup the dependencies typeahead */ libtoaster.makeTypeahead(layerDepInput, libtoaster.ctx.layersTypeAheadUrl, { include_added: "true" }, function(item){
@@ -15,6 +18,21 @@ function layerDetailsPageInit (ctx) { layerDepBtn.removeAttr("disabled"); }); + $(window).on('hashchange', function(e){ + switch(window.location.hash){ + case '#machines': + machineTab.tab('show'); + break; + case '#recipes': + targetTab.tab('show'); + break; + default: + detailsTab.tab('show'); + break; + } + }); + + $(".breadcrumb li:first a").click(function(e){ e.preventDefault(); /* By default this link goes to the project configuration page. However
@@ -143,7 +161,7 @@ function layerDetailsPageInit (ctx) { addRmLayerBtn.removeClass("btn-danger"); } - $("#details-tab").on('show', function(){ + detailsTab.on('show', function(){ if (!ctx.layerVersion.inCurrentPrj) defaultAddBtnText();
@@ -174,7 +192,7 @@ function layerDetailsPageInit (ctx) { $("#no-recipes-yet").hide(); } - $("#targets-tab").removeClass("muted"); + targetTab.removeClass("muted"); if (window.location.hash === "#recipes"){ /* re run the machinesTabShow to update the text */ targetsTabShow();
@@ -189,7 +207,7 @@ function layerDetailsPageInit (ctx) { else $("#no-machines-yet").hide(); - $("#machines-tab").removeClass("muted"); + machineTab.removeClass("muted"); if (window.location.hash === "#machines"){ /* re run the machinesTabShow to update the text */ machinesTabShow();
@@ -202,7 +220,7 @@ function layerDetailsPageInit (ctx) { }); - $("#targets-tab").on('show', targetsTabShow); + targetTab.on('show', targetsTabShow); function machinesTabShow(){ if (!ctx.layerVersion.inCurrentPrj) {
@@ -219,7 +237,7 @@ function layerDetailsPageInit (ctx) { window.location.hash = "machines"; } - $("#machines-tab").on('show', machinesTabShow); + machineTab.on('show', machinesTabShow); $(".pagesize").change(function(){ var search = libtoaster.parseUrlParams();
Signature · 1 line
2.1.4
Re: [PATCH] toaster: layerdetails Fix back button tab behaviour
Hi,
I'm confused. If I Navigate as follows, it fails (i think):
start: http://192.168.168.66:8005/toastergui/project/2/
click Recipes, takes me to :
http://192.168.168.66:8005/toastergui/project/2/recipes/?limit=25&page=1&orderby=name&
click Back , takes me to :
http://192.168.168.66:8005/toastergui/project/2/recipes/
click Back again, takes me to:
http://192.168.168.66:8005/toastergui/project/2/
click Forward, takes me to:
http://192.168.168.66:8005/toastergui/project/2/recipes/?limit=25&page=1&orderby=name&
click Back, takes me to:
http://192.168.168.66:8005/toastergui/project/2/recipes/
click Back again, takes me to:
http://192.168.168.66:8005/toastergui/project/2/
---
Seems like 1 forward == two backs. Is it my browser is chrome on the mac, though I saw the same behaviour with firefox on ubuntu.
-b
Quoted 101 lines · Michael Wood
This completes the behaviour fix of the back button in the layerdetails page as we not only have parameters in our history we also have the hash to indicate which tab is active. As we pop our history we need to show the corresponding tab.
[YOCTO #8252]
Signed-off-by Michael Wood <[email protected]>--- .../toaster/toastergui/static/js/layerdetails.js | 28 ++++++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-)bitbake/lib/toaster/toastergui/static/js/layerdetails.js +23
-6@@ -7,6 +7,9 @@ function layerDetailsPageInit (ctx) { var layerDepsList = $("#layer-deps-list"); var currentLayerDepSelection; var addRmLayerBtn = $("#add-remove-layer-btn"); + var targetTab = $("#targets-tab"); + var machineTab = $("#machines-tab"); + var detailsTab = $("#details-tab"); /* setup the dependencies typeahead */ libtoaster.makeTypeahead(layerDepInput, libtoaster.ctx.layersTypeAheadUrl, { include_added: "true" }, function(item){@@ -15,6 +18,21 @@ function layerDetailsPageInit (ctx) { layerDepBtn.removeAttr("disabled"); }); + $(window).on('hashchange', function(e){ + switch(window.location.hash){ + case '#machines': + machineTab.tab('show'); + break; + case '#recipes': + targetTab.tab('show'); + break; + default: + detailsTab.tab('show'); + break; + } + }); + + $(".breadcrumb li:first a").click(function(e){ e.preventDefault(); /* By default this link goes to the project configuration page. However@@ -143,7 +161,7 @@ function layerDetailsPageInit (ctx) { addRmLayerBtn.removeClass("btn-danger"); } - $("#details-tab").on('show', function(){ + detailsTab.on('show', function(){ if (!ctx.layerVersion.inCurrentPrj) defaultAddBtnText();@@ -174,7 +192,7 @@ function layerDetailsPageInit (ctx) { $("#no-recipes-yet").hide(); } - $("#targets-tab").removeClass("muted"); + targetTab.removeClass("muted"); if (window.location.hash === "#recipes"){ /* re run the machinesTabShow to update the text */ targetsTabShow();@@ -189,7 +207,7 @@ function layerDetailsPageInit (ctx) { else $("#no-machines-yet").hide(); - $("#machines-tab").removeClass("muted"); + machineTab.removeClass("muted"); if (window.location.hash === "#machines"){ /* re run the machinesTabShow to update the text */ machinesTabShow();@@ -202,7 +220,7 @@ function layerDetailsPageInit (ctx) { }); - $("#targets-tab").on('show', targetsTabShow); + targetTab.on('show', targetsTabShow); function machinesTabShow(){ if (!ctx.layerVersion.inCurrentPrj) {@@ -219,7 +237,7 @@ function layerDetailsPageInit (ctx) { window.location.hash = "machines"; } - $("#machines-tab").on('show', machinesTabShow); + machineTab.on('show', machinesTabShow); $(".pagesize").change(function(){ var search = libtoaster.parseUrlParams(); --2.1.4
--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster
Re: [PATCH] toaster: layerdetails Fix back button tab behaviour
Hello Brian.
This is because Toaster does some redirects internally which aren't fixed by this patch (they would require some substantial refactoring which can't really be done while the image customisation branch is pending, as the IC branch changes views.py significantly).
What happens is that Toaster uses RedirectExceptions to control transitions between some pages, but not pages using ToasterTables. Bug 8252 only refers to ToasterTable back button behaviour, not the behaviour of these other pages. I think we need a separate "refactor all pages which don't use ToasterTable" issue for those; I'll raise it.
Elliot
Quoted 140 lines · Brian Avery
Hi,
I'm confused. If I Navigate as follows, it fails (i think):
start: http://192.168.168.66:8005/toastergui/project/2/
click Recipes, takes me to :http://192.168.168.66:8005/toastergui/project/2/recipes/?limit=25&page=1&orderby=name&
click Back , takes me to :
http://192.168.168.66:8005/toastergui/project/2/recipes/
click Back again, takes me to:
http://192.168.168.66:8005/toastergui/project/2/
click Forward, takes me to:http://192.168.168.66:8005/toastergui/project/2/recipes/?limit=25&page=1&orderby=name&
click Back, takes me to:
http://192.168.168.66:8005/toastergui/project/2/recipes/
click Back again, takes me to:
http://192.168.168.66:8005/toastergui/project/2/---
Seems like 1 forward == two backs. Is it my browser is chrome on the mac, though I saw the same behaviour with firefox on ubuntu.
-b
Quoted 10 lines · Michael Wood
This completes the behaviour fix of the back button in the layerdetails page as we not only have parameters in our history we also have the hash to indicate which tab is active. As we pop our history we need to show the corresponding tab.
[YOCTO #8252]
Signed-off-by Michael Wood <[email protected]>--- .../toaster/toastergui/static/js/layerdetails.js | 28++++++++++++++++++----
Review
Quoted 3 lines
1 file changed, 23 insertions(+), 5 deletions(-)(quoted diff) +0
-0b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
bitbake/lib/toaster/toastergui/static/js/layerdetails.js function layerDetailsPageInit (ctx) { · line 15
Quoted 13 lines
index 000e803..8817b47 100644
bitbake/lib/toaster/toastergui/static/js/layerdetails.js +3
-0@@ -7,6 +7,9 @@ function layerDetailsPageInit (ctx) { var layerDepsList = $("#layer-deps-list"); var currentLayerDepSelection; var addRmLayerBtn = $("#add-remove-layer-btn"); + var targetTab = $("#targets-tab"); + var machineTab = $("#machines-tab"); + var detailsTab = $("#details-tab"); /* setup the dependencies typeahead */ libtoaster.makeTypeahead(layerDepInput,libtoaster.ctx.layersTypeAheadUrl, {
include_added: "true" }, function(item){Quoted 12 lines
bitbake/lib/toaster/toastergui/static/js/layerdetails.js +8
-0@@ -15,6 +18,21 @@ function layerDetailsPageInit (ctx) { layerDepBtn.removeAttr("disabled"); }); + $(window).on('hashchange', function(e){ + switch(window.location.hash){ + case '#machines': + machineTab.tab('show'); + break; + case '#recipes': + targetTab.tab('show'); + break;bitbake/lib/toaster/toastergui/static/js/layerdetails.js function layerDetailsPageInit (ctx) { · line 38
Quoted 10 lines
bitbake/lib/toaster/toastergui/static/js/layerdetails.js +7
-0+ default: + detailsTab.tab('show'); + break; + } + }); + + $(".breadcrumb li:first a").click(function(e){ e.preventDefault(); /* By default this link goes to the project configuration page.However
Quoted 48 lines
bitbake/lib/toaster/toastergui/static/js/layerdetails.js +5
-6@@ -143,7 +161,7 @@ function layerDetailsPageInit (ctx) { addRmLayerBtn.removeClass("btn-danger"); } - $("#details-tab").on('show', function(){ + detailsTab.on('show', function(){ if (!ctx.layerVersion.inCurrentPrj) defaultAddBtnText();@@ -174,7 +192,7 @@ function layerDetailsPageInit (ctx) { $("#no-recipes-yet").hide(); } - $("#targets-tab").removeClass("muted"); + targetTab.removeClass("muted"); if (window.location.hash === "#recipes"){ /* re run the machinesTabShow to update the text */ targetsTabShow();@@ -189,7 +207,7 @@ function layerDetailsPageInit (ctx) { else $("#no-machines-yet").hide(); - $("#machines-tab").removeClass("muted"); + machineTab.removeClass("muted"); if (window.location.hash === "#machines"){ /* re run the machinesTabShow to update the text */ machinesTabShow();@@ -202,7 +220,7 @@ function layerDetailsPageInit (ctx) { }); - $("#targets-tab").on('show', targetsTabShow); + targetTab.on('show', targetsTabShow); function machinesTabShow(){ if (!ctx.layerVersion.inCurrentPrj) {@@ -219,7 +237,7 @@ function layerDetailsPageInit (ctx) { window.location.hash = "machines"; } - $("#machines-tab").on('show', machinesTabShow); + machineTab.on('show', machinesTabShow); $(".pagesize").change(function(){ var search = libtoaster.parseUrlParams(); --2.1.4
Quoted 5 lines
--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster
Signature · 3 lines
Elliot Smith Software Engineer Intel Open Source Technology Centre
Re: [PATCH] toaster: layerdetails Fix back button tab behaviour
Quoted 11 lines · Elliot
This is because Toaster does some redirects internally which aren't fixed by this patch (they would require some substantial refactoring which can't really be done while the image customisation branch is pending, as the IC branch changes
views.pysignificantly).What happens is that Toaster uses RedirectExceptions to control transitions between some pages, but not pages using ToasterTables. Bug 8252 only refers to ToasterTable back button behaviour, not the behaviour of these other pages. I think we need a separate "refactor all pages which don't use ToasterTable" issue for those; I'll raise it.
I raised this bug to cover the initial investigation of what needs to be done:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=8363
Elliot
Signature · 3 lines
Elliot Smith Software Engineer Intel Open Source Technology Centre
Re: [PATCH] toaster: layerdetails Fix back button tab behaviour
k.
ty, I'll upstream this one this morning then.
-b
Quoted 23 lines · Elliot
Quoted 11 lines · Elliot
This is because Toaster does some redirects internally which aren't fixed by this patch (they would require some substantial refactoring which can't really be done while the image customisation branch is pending, as the IC branch changes
views.pysignificantly).What happens is that Toaster uses RedirectExceptions to control transitions between some pages, but not pages using ToasterTables. Bug 8252 only refers to ToasterTable back button behaviour, not the behaviour of these other pages. I think we need a separate "refactor all pages which don't use ToasterTable" issue for those; I'll raise it.
I raised this bug to cover the initial investigation of what needs to be done:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=8363Elliot
--
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
Re: [PATCH] toaster: layerdetails Fix back button tab behaviour
k. so not upstreamed in the morning but upstreamed all the same :). ty,
b
Quoted 28 lines · Brian Avery
k.
ty, I'll upstream this one this morning then.
-bQuoted 23 lines · Elliot
Quoted 11 lines · Elliot
This is because Toaster does some redirects internally which aren't fixed by this patch (they would require some substantial refactoring which can't really be done while the image customisation branch is pending, as the IC branch changes
views.pysignificantly).What happens is that Toaster uses RedirectExceptions to control transitions between some pages, but not pages using ToasterTables. Bug 8252 only refers to ToasterTable back button behaviour, not the behaviour of these other pages. I think we need a separate "refactor all pages which don't use ToasterTable" issue for those; I'll raise it.
I raised this bug to cover the initial investigation of what needs to be done:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=8363Elliot
--
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
Quoted 7 lines · On 14/09/2015 16:09, "[email protected] on behalf of Elliot…
Prevent incorrect caching of ToasterTable data so it doesn't go stale as the user navigates browser history with back/forward.
Changes since
75bad1b64bd485a50af69ed1f8663a0dadbb5f9eare in:git://git.yoctoproject.org/poky-contrib, elliot/toaster/bad_caching-7660
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=elliot/toaster/ba
d_caching-7660
This works for me: table entries seem to show the correct states now.
Thanks!
Belén
Quoted 40 lines
Related bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7660
I haven't tested every permutation of table navigation with this patch, but issue 7660 is fixed.
NB Bug 8294 (https://bugzilla.yoctoproject.org/show_bug.cgi?id=8294)
causes incorrect data to display in a similar way, but the root cause seems to be different (it's due to incorrect context update there, rather than caching). This patch doesn't fix that.Elliot Smith (2):
toaster: Don't add new history entries when table data loads
toaster: Don't HTTP cache ToasterTable responsesbitbake/lib/toaster/toastergui/static/js/table.js | 2 +-
bitbake/lib/toaster/toastergui/widgets.py| 5 +++++2 files changed, 6 insertions(+), 1 deletion(-)--
Elliot Smith
Software Engineer
Intel OTC---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Signature · 4 lines
_______________________________________________ toaster mailing list [email protected] https://lists.yoctoproject.org/listinfo/toaster