Skip to content

localstorage unavailability during initialization #55

@mickeyreiss-visor

Description

@mickeyreiss-visor

Is it the caller's responsibility or the SDK's responsibility to handle localStorage errors during initialization?

https://github.com/launchdarkly/js-client/blob/39495f9851b83ed743f5b590639f683079e60ba0/src/index.js#L256-L263

I'm wondering if the call to setItem in the catch block could possibility throw an uncaught exception.

My concern comes from the fact that we often see localStorage throw SecurityExceptions in production, especially on mobile, where it is locked when the device is locked or maybe when the user is in incognito/private browsing mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions