-
-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] If local storage is unavailable, provide an in-memory alternative #188
Comments
Hey @csharpfritz! Thanks for raising this issue. I didn't realise local storage was disabled along with cookies--you learn something new everyday! Yes, I think swapping to an in-memory option would be possible. It's what we do for the test extensions already. I think this should be a setting developers turn on, rather than being a default. Some new API like, |
I like the idea of a configuration option, but I think if localStorage isn’t available, developers should have an appropriate exception thrown
Jeff
… On Aug 27, 2022, at 18:43, Chris Sainty ***@***.***> wrote:
Hey @csharpfritz!
Thanks for raising this issue. I didn't realise local storage was disabled along with cookies--you learn something new everyday!
Yes, I think swapping to an in-memory option would be possible. It's what we do for the test extensions already.
I think this should be a setting developers turn on, rather than being a default. Some new API like, 'EnableInMemoryStorageFallback'. We can then use the result of the 'navigator.cookieEnabled' JavaScript API to enable the in-memory provider.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Interesting, what use would the exception have for developers? The issue will only surface when the application is running on end users devices. Throwing an exception at that point would potentially kill the application, depending on how the developer has designed their code. Wouldn't this be a feature a developer would enable ahead of time in order to keep things running if the end user has disabled cookies? EDIT: Just realised, do you mean throw an exception if the developer hasn't enabled the new in-memory feature? So thing don't fail silently. |
I'm referring to an exception if AppSettings is inaccessible and the In-Memory fallback is not enabled. "AppSettingsUnavailableException" or similar |
Hi, This would be a great addition! Am I correct to assume that data in the InMemory fallback only exists untill the user reloads the app? |
Yes, in a WebAssembly scenario all context is lost when the app is reloaded.
For users who are privacy concerned, this should be a fair consideration in exchange for not writing any content to the local disk.
… On Sep 8, 2022, at 06:19, joepvtl ***@***.***> wrote:
Hi,
This would be a great addition! Am I correct to assume that data in the InMemory fallback only exists untill the user reloads the app?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Sorry this has taken so long to make any progress. I've added in a new For now, I've decided not to implement a fall back though. This is due to the fact it will behave differently to how local storage, i.e. not persistent and I'd like to get a bit more feedback on this before I add it to the library. The work for the exception has been separated out into #192 to keep things tidy. This issue can remain for the potential fallback option. |
Is your feature request related to a problem? Please describe.
If a user has disabled cookies in their browser, all local storage access throws an error.
Describe the solution you'd like
Can we provide an alternate in-memory storage provider instead of using the browser localStorage so that code will still work, but not persist between sessions.
The text was updated successfully, but these errors were encountered: