Rho 4 bug report - localStorage is broken in certain circumstances

D Dan McCabe 2 years 11 months ago
0 2 0

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.

   
    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);
        }
       
    };
   

Version 2
Local storage test

Please register or login to post a reply

2 Replies

A Aman Kumar

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

V Vinod Shankar K

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 01/06/2009 21:07:21:000 094700ba RhoWKBrowserEngine.cpp: 558| JS Log: http://192.168.6.27/vinod/DemoTries/launchpad.html, line 14: hasStorage res: true

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

CONTACT
Can’t find what you’re looking for?