Make clearModelCache also empty the OPFS model store #13
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In web/js/model-cache.js,
clearModelCacheclears only the Cache Storage cache namedelffuss-models-v1.clearAllof./runtime/model-store.jsempties the OPFS store, and weights there were never freed by this button, so it looked broken: usage did not go down. Why it matters: The button exists to free space; if the larger store is left untouched, the user sees no change and loses trust in the control.Proposal
After clearing Cache Storage, import
./runtime/model-store.jsand await itsclearAll, inside a try block so a missing store does not make the button fail.Acceptance criteria
clearModelCache()resolves, the OPFS entryelffuss-modelshas been removed, and the Cache Storage cacheelffuss-models-v1is still deleted.clearModelCache()resolves without throwing whennavigator.storage.getDirectoryrejects, after having called it once.Files
web/js/model-cache.jsT2T-Issue: 0xb8d7c6d9815eb6af5efae391d136467cda8c028200c2b5ec5a36fa6620196c53
Number: 10
Kind: bug
Origin: imported
Proposer: 0x08809b42d05ae9526f4aa4c9670ce168aac68919
Ledger: elffuss/ledger, event 515