[Silk UI Framework] DeviceType causes infinite loop on page load

[Silk UI Framework] DeviceType causes infinite loop on page load

  
Forge Component
(45)
Published on 10 May by OutSystems Labs
45 votes
Published on 10 May by OutSystems Labs
Hello,
In the last version of SilkUI and also after the upgrade to the last version launched this week, we got a serious and critical bug that results on a infinite loop on the page load.
After some debug on the SilkUI javascript blocks, I found the cause of problem.
The problem occurs only in some user’s browsers and, since that user never entered in any page of that server (where SilkUI is installed) before.
Basically, when we enter in any page (under the previous conditions) having the block WidgetsForLayout  that contains both DeviceDetect and SilkUICommon Web blocks, the page never loads and starts an infinite loop of page reloads.
Digging in the code: when the code of this two blocks try to check if cookie = server device, one of the conditions is verified and the code enters the instruction to refresh page to set same device on server and client side. In the code we can see:
 
// check if cookie = server device
if(serverDevice.length < 1 || device.indexOf(serverDevice) < 0 ){
    // refresh page to set same device on server and client side
    location.reload();
}
 
Where the variable device = null.
To fix this I added the following instruction:
document.cookie = "DEVICE_TYPE="+that.getDevice()+";";
 
So, the code works and stays like this:
// check if cookie = server device
if(serverDevice.length < 1 || device.indexOf(serverDevice) < 0 ){
   // refresh page to set same device on server and client side
   document.cookie = "DEVICE_TYPE="+that.getDevice()+";";
   location.reload();
}
 
However, since SilkUI is supposed to be a close module to enable the recurrent upgrades, I think that you should provide us some real fix to this problem, to avoid this change in the eSpace SilkUIFramework (this code snippet is just a workaround).
Hope to have some feedback and thank you for your attention.
 
Kind Regards,
Gonçalo Martins

Hello Gonçalo,

Sorry for the late reply. 
In order to better understand the issue, we need some more information:
  • In what browsers can you see that issue happening?
  • What is the exact version of Silk UI you have installed on your server?
Best Regards,
Samuel Jesus
Hello Samuel,

About the additional information, I can say:

  • In what browsers can you see that issue happening? The browsers we used to test this were - Internet Explorer / Firefox and Chrome.
  • What is the exact version of Silk UI you have installed on your server? 1.2.1 but we noticed this behavior on the previous versions.
 Hope you can help us on this issue, since is very critical and I also have some colleges with the same problem.

Kind Regards,
Gonçalo M.
Hello Gonçalo,

We have been trying to replicate the issue and so far with no success.

Although you have already confirmed that you are using the latest version (1.2.1) of Silk UI, can you please confirm what is the theme you are using, its version, and if it has its references updated with Silk ? 

We have seen a similar behaviour on another Silk UI installation, and it was caused by upgrading Silk UI framework while leaving the Themes (Dublin in this case), outdated. The outdated references were the cause of the wrong behaviour.
 
As such can you please either upgrade the themes that you are using or update it's references?
 
Best Regards,
Samuel Jesus



Hello Samuel,

I'm not sure if I understood your question, but I think that this image can help: