Make clearModelCache also empty the OPFS model store #13

Open
opened 2026-10-02 08:05:17 +00:00 by elffuss-bot · 0 comments
Owner

In web/js/model-cache.js, clearModelCache clears only the Cache Storage cache named elffuss-models-v1. clearAll of ./runtime/model-store.js empties 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.js and await its clearAll, inside a try block so a missing store does not make the button fail.

Acceptance criteria

  1. After clearModelCache() resolves, the OPFS entry elffuss-models has been removed, and the Cache Storage cache elffuss-models-v1 is still deleted.
  2. clearModelCache() resolves without throwing when navigator.storage.getDirectory rejects, after having called it once.

Files

  • web/js/model-cache.js

T2T-Issue: 0xb8d7c6d9815eb6af5efae391d136467cda8c028200c2b5ec5a36fa6620196c53
Number: 10
Kind: bug
Origin: imported
Proposer: 0x08809b42d05ae9526f4aa4c9670ce168aac68919
Ledger: elffuss/ledger, event 515

In web/js/model-cache.js, `clearModelCache` clears only the Cache Storage cache named `elffuss-models-v1`. `clearAll` of `./runtime/model-store.js` empties 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.js` and await its `clearAll`, inside a try block so a missing store does not make the button fail. ### Acceptance criteria 1. After `clearModelCache()` resolves, the OPFS entry `elffuss-models` has been removed, and the Cache Storage cache `elffuss-models-v1` is still deleted. 2. `clearModelCache()` resolves without throwing when `navigator.storage.getDirectory` rejects, after having called it once. ### Files - `web/js/model-cache.js` --- T2T-Issue: 0xb8d7c6d9815eb6af5efae391d136467cda8c028200c2b5ec5a36fa6620196c53 Number: 10 Kind: bug Origin: imported Proposer: 0x08809b42d05ae9526f4aa4c9670ce168aac68919 Ledger: elffuss/ledger, event 515
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: elffuss/code#13