Giter VIP home page Giter VIP logo

Comments (6)

mikechu-optimizely avatar mikechu-optimizely commented on June 9, 2024 1

It looks like we later added a bit of bullet-proofing around localStorage, if I'm reading the nature of this request.

Of course, feel free to re-open this Issue with additional info.

from javascript-sdk.

mikeproeng37 avatar mikeproeng37 commented on June 9, 2024

Thanks for raising this issue! Our team will look into it and get back to you as soon as we can. Can you tell us which version of the SDK you are using?

from javascript-sdk.

MisterJimson avatar MisterJimson commented on June 9, 2024

I suggest using an in memory cache when localstorage is not useable. We do this in all our sites, common workaround.

from javascript-sdk.

toser avatar toser commented on June 9, 2024

@MisterJimson Thanks for the suggestion. IMHO this kind of workaround is very dependent on the use case. It might work with your own code, but third party libs could depend on the persistence of the store and break. For example with Optimizely it could break your A/B tests.
So I prefer to handle it explicitly by use case, not with a catch all workaround.

from javascript-sdk.

MisterJimson avatar MisterJimson commented on June 9, 2024

@toser Sure, but are the A/B tests not already broken if an exception is thrown when the SDK tries to store a value?

from javascript-sdk.

toser avatar toser commented on June 9, 2024

@MisterJimson I don't have the insights how Optimizely works here. But in general it's better to not fake a working localstorage where it's actually just a memory store. This can cause strange behavior. Then it's better to let the browser throw an error and the lib handles the error itself.

from javascript-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.