Fix KV storage clear() to sync with localStorage

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-17 00:58:11 +00:00
parent 3c16bcc9a7
commit d2df1ce4ee

View File

@@ -62,7 +62,11 @@ export const sparkRuntime = {
},
clear: () => {
try {
// Get keys before clearing
const keysToRemove = Array.from(kvStorage.keys())
kvStorage.clear()
// Clear corresponding keys from localStorage
keysToRemove.forEach(key => localStorage.removeItem(key))
} catch (error) {
console.error('Error clearing KV storage:', error)
}