Skip to content

K2GO-427 feat(cx-core): delete + storage endpoints - #680

Merged
luisguzman-adfa merged 2 commits into
mainfrom
feat/K2GO-427-cx-core-delete-storage
Oct 23, 2026
Merged

luisguzman-adfa merged 2 commits into
mainfrom
feat/K2GO-427-cx-core-delete-storage

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

Two cx-core endpoints the content manager needs. No dash-node change: its /v1/* relay is
generic, so new core endpoints are exposed with no bump.

  • DELETE /v1/content/{app}/{localRef} -> {ok, freedBytes}. Delegates to each app's own
    delete (never drives the DB/files directly): Kolibri manage deletechannel (synchronous
    CLI; freedBytes is a free-space delta, since channels share content-addressed files),
    Kiwix removes the .zim then re-runs iiab-make-kiwix-lib (freedBytes = the file size),
    Calibre-Web POST /delete/{id} (calibredb absent; freedBytes = the item's known size).
    404 when the item is absent (idempotent-safe); the front confirms the destructive action.
  • GET /v1/storage -> {volume, totalBytes, freeBytes, usedByContentBytes, perApp}. The box
    content-volume disk summary plus per-app content totals (usedByContentBytes is an estimate;
    totalBytes/freeBytes are authoritative).

Verification: 124 unit tests pass (was 102).

@
K2GO-427 feat(cx-core): add delete and storage endpoints

DELETE /v1/content/{app}/{localRef} reclaims one item by delegating to each
app own delete (Kiwix rm + reindex, Kolibri deletechannel CLI, Calibre-Web
/delete); freedBytes is what the app actually reclaimed. GET /v1/storage reports
the content volume disk plus per-app content totals. Both unblock the K2Go
content manager; dash-node relay is generic and needs no change.
@
@
K2GO-427 fix(cx-core): refine delete freedBytes and storage estimate note

Calibre freedBytes uses the book known size (self-contained, no shared files)
instead of a free-space delta. Kolibri keeps the delta but labels freedBytes
approximate (whole-volume read) and flags on-device verification that
deletechannel is synchronous. /v1/storage notes usedByContentBytes is an
estimate (shared files counted per channel); disk total/free stay authoritative.
@
@luisguzman-adfa
luisguzman-adfa merged commit 3e4aeda into main Oct 23, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the feat/K2GO-427-cx-core-delete-storage branch October 23, 2026 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant