Make clearModelCache also empty the OPFS model store in Elffuss Code #2

Open
opened 2026-10-02 06:29:35 +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. The sibling app already also calls clearAll of ./runtime/model-store.js because weights in the OPFS store were never freed, so the Settings button 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, clearAll of ./runtime/model-store.js has been called exactly once.
  2. clearModelCache() resolves without throwing when clearAll rejects.
  3. clearModelCache() still deletes the Cache Storage cache named elffuss-models-v1.

Files

  • web/js/model-cache.js

T2T-Issue: 0x8565fcd82db1b9b10968a7870fd214de03dc20264bad61589532ace018f5a403
Number: 2
Kind: bug
Origin: imported
Proposer: 0x08809b42d05ae9526f4aa4c9670ce168aac68919
Ledger: elffuss/ledger, event 97

In web/js/model-cache.js, `clearModelCache` clears only the Cache Storage cache named `elffuss-models-v1`. The sibling app already also calls `clearAll` of `./runtime/model-store.js` because weights in the OPFS store were never freed, so the Settings button 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, `clearAll` of `./runtime/model-store.js` has been called exactly once. 2. `clearModelCache()` resolves without throwing when `clearAll` rejects. 3. `clearModelCache()` still deletes the Cache Storage cache named `elffuss-models-v1`. ### Files - `web/js/model-cache.js` --- T2T-Issue: 0x8565fcd82db1b9b10968a7870fd214de03dc20264bad61589532ace018f5a403 Number: 2 Kind: bug Origin: imported Proposer: 0x08809b42d05ae9526f4aa4c9670ce168aac68919 Ledger: elffuss/ledger, event 97
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: elffuss/code#2