Fossil SCM

Cherrypick [d2d8894bb2]: fossil.storage.clear() is now also sandboxed - no longer nuking all state for all repos on the same origin.

stephan 2020-08-18 21:03 branch-2.12
Commit d0988e677c15bc1b3fc9937e3d75d558642c99b9ecb18f0b488308867f65c208
1 file changed +1 -1
--- src/fossil.storage.js
+++ src/fossil.storage.js
@@ -121,11 +121,11 @@
121121
$storage.removeItem(storageKeyPrefix+k);
122122
return this;
123123
},
124124
/** Clears ALL keys from the storage. Returns this. */
125125
clear: function(){
126
- $storage.clear();
126
+ this.keys().forEach((k)=>$storage.removeItem(/*w/o prefix*/k));
127127
return this;
128128
},
129129
/** Returns an array of all keys currently in the storage. */
130130
keys: ()=>Object.keys($storageHolder).filter((v)=>(v||'').startsWith(storageKeyPrefix)),
131131
/** Returns true if this storage is transient (only available
132132
--- src/fossil.storage.js
+++ src/fossil.storage.js
@@ -121,11 +121,11 @@
121 $storage.removeItem(storageKeyPrefix+k);
122 return this;
123 },
124 /** Clears ALL keys from the storage. Returns this. */
125 clear: function(){
126 $storage.clear();
127 return this;
128 },
129 /** Returns an array of all keys currently in the storage. */
130 keys: ()=>Object.keys($storageHolder).filter((v)=>(v||'').startsWith(storageKeyPrefix)),
131 /** Returns true if this storage is transient (only available
132
--- src/fossil.storage.js
+++ src/fossil.storage.js
@@ -121,11 +121,11 @@
121 $storage.removeItem(storageKeyPrefix+k);
122 return this;
123 },
124 /** Clears ALL keys from the storage. Returns this. */
125 clear: function(){
126 this.keys().forEach((k)=>$storage.removeItem(/*w/o prefix*/k));
127 return this;
128 },
129 /** Returns an array of all keys currently in the storage. */
130 keys: ()=>Object.keys($storageHolder).filter((v)=>(v||'').startsWith(storageKeyPrefix)),
131 /** Returns true if this storage is transient (only available
132

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button