Hard Dependency on Local Storage Breaks Page in iOS Private Browsing

Home Forums Calendar Products Filter Bar Hard Dependency on Local Storage Breaks Page in iOS Private Browsing

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1172430
    Josh
    Participant

    Hello,

    It looks like the filterbar has a hard dependency on local storage insofar as it fails to check if local storage is available before attempting to use it. It has the following conditional:

    tribe_storage&&tribe_storage.setItem("tribe_events_filters_wrapper","closed")

    iOS private browsing mode disables local storage. When the filterbar is used on iOS in private browsing mode, the script throws an error, which prevents other JavaScript on the page from running thereby breaking the page.

    Here is the error it throws:


    [Error] QuotaExceededError: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota.
    setItem (filter-scripts-shim.min.js:12:1629)
    n (filter-scripts-shim.min.js:12:1629)
    (anonymous function) (filter-scripts-shim.min.js:12:4013)
    i (jquery.js:2:27455)
    fireWith (jquery.js:2:28215)
    ready (jquery.js:2:30018)
    K (jquery.js:2:30374)

    As a temporary fix, I have had to dequeue the script and enqueue a “shimmed” version with the following function added and with the check changed:


    // added this function
    function hasLocalStorage(){
    var test = 'test';
    try {
    localStorage.setItem(test, test);
    localStorage.removeItem(test);
    return true;
    } catch(e) {
    return false;
    }
    }
    // modified the check
    hasLocalStorage()&&tribe_storage&&tribe_storage.setItem("tribe_events_filters_wrapper","closed")

    Can you please address the issue in the source code and release a fix?

    Thank you

    #1172987
    Nico
    Member

    Hi there Josh,

    Thanks for reaching out to report this issue and for the suggested fix too!

    This is actually a known bug that has been around for some time. I’ll update our internal ticket with your suggested solution and try to move the ticket forward đŸ™‚

    I’ve linked this thread with the ticket, so you’ll get a heads-up when this is fixed and shipped. Also, I’ll set this thread to Pending fix so it doesn’t get autoclosed.

    Thanks once again,
    Best,
    Nico

    #1193643
    George
    Participant

    Hello!

    I wanted to inform you that we’ve just published a series of updates to our products that fixes a number of issues.

    We’ve fixed the Private Browsing-related issues reported here.

    Learn more about this release—version 4.3.3—in the official release notes here → https://theeventscalendar.com/maintenance-release-events-calendar-4-3-3-event-tickets-4-3-3-premium-plugins/

    Thanks for your patience while we fixed this!
    George

    #1203233
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Hard Dependency on Local Storage Breaks Page in iOS Private Browsing’ is closed to new replies.