Results 1 to 2 of 2

Thread: If localStorage limit is exceeded the relevant item is deleted

    You found a bug! We've classified it as TOUCH-5385 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Jan 2014
    Posts
    9

    Default If localStorage limit is exceeded the relevant item is deleted

    While writing to the localStorage the old item is removed first the new value is inserted back as a new item with same name. It's written in the source code that this behaviour is to fix some bug about iPad. However this makes the exception handling useless bec. the data is already gone as the exception is thrown...
    Setting the value in a variable first and recovering it might be a solution. It'll occupy some memory for a short time but I don't think it would be a problem... i.e.

    Code:
    var oldItem = obj.getItem(key);
    obj.removeItem(key);
    try {
        obj.setItem(key, Ext.encode(data));
    } catch(e){
        obj.setItem(key, oldData);
        this.fireEvent('exception', this, e);
    }
    delete oldItem; // might be inside "finally"

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    Thanks for the report! In order to expedite bug reports in the future please use the following form.
    http://www.sencha.com/forum/showthread.php?273895-How-to-report-a-bug
    When referring to code in the framework please include class and method name that you are referring as well as version of the framework.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •