You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In firefox, there are times when my local storage hits the limit.
This results in DOMException: The quota has been exceeded. error which is caught by cache-interceptor plugin.
When it's caught, plugin tries to free some space:
The issue here is I might have other values stored in localStorage and cache-interceptor will attempt to meddle with them at the location I mentioned above.
If I store a value like localStorage.set("mytheme", "dark");, plugin will attempt to call JSON.parse with "dark" as an argument.
This results in SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data.
This may not occur if I set a prefix for my storage.
My suggestion to avoiding this is to perhaps add a default prefix value to plugin.
Describe the bug
In firefox, there are times when my local storage hits the limit.
This results in
DOMException: The quota has been exceeded.
error which is caught by cache-interceptor plugin.When it's caught, plugin tries to free some space:
axios-cache-interceptor/src/storage/web-api.ts
Line 45 in f4f4be1
The issue here is I might have other values stored in
localStorage
and cache-interceptor will attempt to meddle with them at the location I mentioned above.If I store a value like
localStorage.set("mytheme", "dark");
, plugin will attempt to callJSON.parse
with "dark" as an argument.This results in
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
.This may not occur if I set a prefix for my storage.
My suggestion to avoiding this is to perhaps add a default prefix value to plugin.
To Reproduce
Make sure localStorage gets full.
Expected behavior
Should not throw errors.
The text was updated successfully, but these errors were encountered: