1

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.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
ChrisP
  • 45
  • 5
  • While this will likely be looked at, you should note that FireFox Developer Edition is not a supported browser, and I believe it's still in its alpha stages... IBM Worklight does not support it at this time. http://www-969.ibm.com/software/reports/compatibility/clarity-reports/report/html/prereqsForProduct?deliverableId=968A9CE03A2E11E396F9FC10E99BE807#sw-11 – Idan Adar Nov 28 '14 at 04:51

1 Answers1

0

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.

Community
  • 1
  • 1
cnandreu
  • 5,113
  • 3
  • 25
  • 50