Worklight JsonStore Error When Using FireFox Developer Edition

263 views Asked by At

I'm currently developing a mobile web app using Eclipse / Worklight v6.2. The app uses the local json store for data storage. When I run my app using FireFox v33.1 and I clear the json store from a function within my app it works exactly as expected. However, if I use FireFox Developer Edition v35.0a2 when I invoke the same function, the local json store is not cleared and I get the following error:

"main :: localStoreClear :: Attempting to destroy JSON store..."    
    Uncaught Exception: TypeError: meta is null at (compiled_code):1751" worklight.js:4886
        WL.Logger</__log() worklight.js:4886
        WL.Logger</</PUBLIC_API[priority]() worklight.js:5240
        WL.Logger</window.onerror() worklight.js:5202
    TypeError: meta is null jsonstore.js:1751

This is the function within my app that I am calling:

/**
 * Destroy the local JSON store and reinitialise it
 */
function localStoreClear() {
    WL.Logger.info("main :: localStoreClear :: Attempting to destroy JSON store...");   
    WL.JSONStore.destroy()
    .then(function() {
        WL.Logger.info("main :: localStoreClear : Destroyed!");

        // Reinitialise store
        localStoreInit();
    })
    .fail(function() {
        WL.Logger.info("main :: localStoreClear : Failed to destroy!");
    });
}

From the error message that I receive, it looks like the error is being thrown in the jsonstore.js file? Can anyone tell me if I'm doing something wrong, or if there is a compatibility issue between the FireFox Developer Edition and Worklight?

Many thanks in advance,

Chris.

1

There are 1 answers

0
cnandreu On BEST ANSWER

Answer:

Firefox Developer Edition is not a supported browser. If you encounter this issue on a supported browser, you may want to open a PMR with steps to reproduce. You may open a feature request to make that browser a supported browser.

Workaround:

If you don't mind removing everything inside HTML5 local storage, this will clear everything JSONStore saves when running in a JavaScript-only environment (i.e. not Android, iOS, WP8 or Win8):

localStorage.clear();

If you want to be more selective, I believe all the JSONStore html5 local storage keys are prefixed with jsonstore. You can look at local storage following these steps here.

Note: The information above only applies to JSONStore code running on the web browser.