Rho 4 bug report - localStorage is broken in certain circumstances

Steps to reproduce:

1. Install RhoElements 4.0.0 CE Runtime.cab on MC9190CE.

2. Point it at the web page below, hosted on a server.

3. You will get: line 21: hasStorage catch:Error: QUOTA_EXCEEDED_ERR: DOM Exception 22 in the log file.

4. If the web page is stored locally on the device, you will not see the error.

I believe the problem exists in all 4 versions of the shared runtime.

This makes it impossible to deploy offline web apps using Rho 4.

This works fine in Rho 2.

It shouldn't matter, but the device is not licensed.

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8" />

<script type="text/javascript">

   

    function hasStorage(){

        try {

            var nt = new Date().getTime();

            localStorage.setItem('hscheck', nt);

            var st = localStorage.getItem('hscheck');

            if (nt == st){

                console.log("hasStorage res: true");

                return true;

            }else{

                console.log("hasStorage res: false");

                return false;

            }

        } catch(err) {

            console.log("hasStorage catch:"+err);

            return false;

        }

    }

   

    function go(){ 

        try{

            if (!hasStorage()){

                document.body.innerHTML += "Local Storage NO";

            }else{

                document.body.innerHTML += "Local Storage YES";

            }

        }catch(err){

            console.log(err);

        }

       

    };

   

</script>

</head>

<body onload="go()">

Version 2<br />

Local storage test<br />

</body>

</html>

Vinod Shankar K
Hi,I have tried same above

Hi,

I have tried same above code which is hosted on webserver on RhoElements 4.0.0 CE Runtime.cab on MC9190CE.

It just works fine for me here. Please see below success message from rholog file. It didn't through any error after trying for multiple times.

I have also tried with MC75WM and MC92CE it also works fine.

Can you try after cold booting the your device and installing it freshly.

Regards

Vinod Shankar

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Dan McCabe
Vinod,Thanks for testing this

Vinod,

Thanks for testing this.

There is clearly something flaky going on here.

I cold booted.

I installed RhoElements 4.0.0 CE Runtime.cab

I copied over config.xml.

Ran rho.

Didn't work.

I cold booted.

I installed RhoElements 2.2.1.13 CE Runtime.cab

I copied over same config.xml.

Ran rho.

It worked.

I installed Rho 4 over the top of Rho 2.

Copied over the config

It worked.

Cold booted.

Installed Rho 4 again.

Copied over the config.

Didn't work.

Can you try this again from a completely clean Rho 4 install?

Thx,

Dan

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Peter Arcuri
My experience was to use the

My experience was to use the config.xml file that comes with the version installed. Config file from 2.2 shouldn't be used with 4.0 installs and vice versa. Once you install 4.0 pull its config.xml file and apply required update. Then re-deploy to the device and launch RhoE.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Dan McCabe
Thanks for the suggestion

Thanks for the suggestion.

That's not it.

I am using a v4 config file.

The default v4 config file is exactly the same as the default v2 config file, except that it adds:

  <TabInstance>

    <NewTabPhysicalMemLimit value="90"/>

    <NewTabVirtualMemLimit value="80"/>

  </TabInstance>

 

  <Engine>

    <EngineTimeout value="60000"/>

  </Engine>

The v4 config file works fine for me in v2.

And, the v4 config file works fine for me in v4, if I install v2 first then v4 over it.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Vinod Shankar K
Hi,Can you check the path of

Hi,

Can you check the path of <WebStorageDBPath value="file://%INSTALLDIR%"/> in config.

In this path please check whether you are getting  "http_someservername.ekiohstorage" file after executing your script. If you are getting this file then it should work.

I have tested above same code by cold booting the 9190CE on RMS4.0.0 Shared run time, it is working for me.

Regads

Vinod Shankar

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Dan McCabe
The path is the default.Yes,

The path is the default.

Yes, I am getting the file.

No, it still doesn't work.

Dan

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Vinod Shankar K
Hi,Can you please provide

Hi,

Can you please provide your "http_someservername.ekiohstorage" file and rholog file in the failure case, What is BSP you are using for 9190CE and Which shared runtime you are using, I mean Persistent or normal.

Regards

Vinod Shankar

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Dan McCabe
Vinod,I have sent a dropbox

Vinod,

I have sent a dropbox link containing everything to the email in your profile.

Please let me know if you didn't get it.

Dan

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Vinod Shankar K
Hi DanI am suspecting it is

Hi Dan

I am suspecting it is problem with the server where your page is hosted.

I used same shared runtime that you have shared with me and OEM version of my MC9190 CE: 03.37.0000

When i used your online webpage for localstorage test, i got the error what you have got. And there is no localstorage value stored in "http_someservername.ekiohstorage"

Error message

I 01/01/2009 00:11:55:000 0a11019a RhoWKBrowserEngine.cpp: 558| JS Log: http://demo.avalon-mobile.com/si/av/danrho/ls.html, line 21: hasStorage catch:Error: QUOTA_EXCEEDED_ERR: DOM Exception 22

Later I hosted your same code in my local as well as github link http://vinodshankar.github.io/vinodmoto/launchpad.html

It worked very well.

Success message

I 10/29/2013 14:02:16:000 0ae80006 RhoWKBrowserEngine.cpp: 558| JS Log: http://vinodshankar.github.io/vinodmoto/launchpad.html, line 14: hasStorage res: true


You can use this git link to test http://vinodshankar.github.io/vinodmoto/launchpad.html

Regards

Vinod Shankar

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Dan McCabe
For all of those that come

For all of those that come later, the resolution to this problem is as follows:

Local Storage in Rho 4.0.0.0 does not work if you have a dash in your server name - like http://server.foo-bar.com/test.html

This was not an issue in Rho 2.

Dan

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Robert Galvin
DanThanks for sharing the

Dan

Thanks for sharing the resolution - Glad you finally have a resolution to the problem.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Aman Kumar
This bug will be resolved in

This bug will be resolved in the upcoming RhoMobile Suite 4.2 version.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments