Lawnchair .nuke() not working after filling my storage quota
Asked Answered
G

3

5

I'm using Lawnchair to store persistent data using the "dom adapter" of my web client (Firefox 13.0) and have hit the storage quota. Console.log says

Persistent storage maximum size reached

Fair enough; I'll just nuke it with this:

<script type="text/javascript" charset="utf-8">
            Lawnchair(function() {
                this.nuke();
                console.log("nuked");
            });
</script>

Before I hit my storage quota, the code above worked to wipe everything out of persistent storage. But now it doesn't work. The page displays fine, but console log shows nothing. I expect it to say "nuked" as it used to.

The following code displays all of my persistent data (after trying to nuke() it with the code above).

<script type="text/javascript" charset="utf-8">
            Lawnchair(function() {
                this.keys(function(values) {
                        values.forEach(console.log)
                    })
            });
</script>

How can I make Lawnchair.nuke() work after it's hit its storage limit?

Gob answered 1/5, 2012 at 1:57 Comment(0)
M
1

You can use localStorage.clear() - just to be on the safe side. But nevertheless, open Chrome devltools and see what is the state of your localStorage... It will show you in a table (key,val) what is going on inside the local storage.

You might also want to debug the nuke and see why it's not working in your case. It might be due to some keys changes or a bug.

Major answered 16/5, 2012 at 18:45 Comment(0)
R
1

Try this:

Lawnchair( function() {
this.keys( function(key) {
this.remove(key);})
});
Rasla answered 23/2, 2013 at 0:25 Comment(0)
U
1

This was a bug. I ran into the same problem. Pulling from github and running 'make build' to generate the current lawnchair in lib/ fixed the problem.

Unaffected answered 9/4, 2013 at 11:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.