Cloud storage breakdown: what uses the space, what shares assets #8

Open
opened 2026-09-25 14:05:44 +02:00 by kyuubi · 3 comments
Owner

A Cloud Storage button in the inventory's button bar opens a dash popup (the dash's own OpenModalOverlay: private, closes on click outside). The popup shows where the user's cloud storage goes.

Model

  • Scan once: the inventory through the game's folder walk (GetRecordsInHierarchy), plus the user's worlds through the paged record search (own and private). Items whose listing has no asset manifest are fetched one by one. The scan downloads no assets.
  • Each asset counts once. Per item and per folder:
    • uses: all assets it references
    • frees: assets nothing outside it references, which is what deleting it gives back
  • A folder's frees is the sum of its children's frees plus a "shared by several of these" line, so the totals add up.
  • Sharing list for an item or folder: every other item it shares assets with, and how much, plus what deleting it together with all of them frees.
  • A top-level row for space not in any scanned item: used storage as the cloud reports it, minus the scan's total.

UI

  • Rows: name, a two-tone bar (only-here part and shared part), frees, uses. Sorted by frees. Folders open, items open their sharing list, and a back button returns.
  • Busy folders show the biggest 200 rows plus a summary row.
  • The scan runs in the background with live counts; a Rescan button starts it again.

Plan

  • Pure usage model with tests: uses and frees per item and folder, the shared line, sharing lists, "delete together"
  • Cloud scanner: inventory walk, worlds search, missing manifests
  • Popup UI in the dash modal overlay
  • Button next to Copy to Local Storage
  • README, version 0.6.0, deploy
  • In game: open it, check totals against the storage figure, open a folder and a sharing list
A **Cloud Storage** button in the inventory's button bar opens a dash popup (the dash's own `OpenModalOverlay`: private, closes on click outside). The popup shows where the user's **cloud** storage goes. ## Model - Scan once: the inventory through the game's folder walk (`GetRecordsInHierarchy`), plus the user's worlds through the paged record search (own and private). Items whose listing has no asset manifest are fetched one by one. The scan downloads no assets. - Each asset counts once. Per item and per folder: - **uses**: all assets it references - **frees**: assets nothing outside it references, which is what deleting it gives back - A folder's frees is the sum of its children's frees plus a **"shared by several of these"** line, so the totals add up. - **Sharing list** for an item or folder: every other item it shares assets with, and how much, plus what deleting it **together with all of them** frees. - A top-level row for **space not in any scanned item**: used storage as the cloud reports it, minus the scan's total. ## UI - Rows: name, a two-tone bar (only-here part and shared part), frees, uses. Sorted by frees. Folders open, items open their sharing list, and a back button returns. - Busy folders show the biggest 200 rows plus a summary row. - The scan runs in the background with live counts; a Rescan button starts it again. ## Plan - [ ] Pure usage model with tests: uses and frees per item and folder, the shared line, sharing lists, "delete together" - [ ] Cloud scanner: inventory walk, worlds search, missing manifests - [ ] Popup UI in the dash modal overlay - [ ] Button next to Copy to Local Storage - [ ] README, version 0.6.0, deploy - [ ] In game: open it, check totals against the storage figure, open a folder and a sharing list
Author
Owner

0.6.0 is built and deployed (5775cd7). It covers the usage model, the cloud scanner, the popup over the dash and the button next to Copy to Local Storage.

Verified:

  • 79 tests: 78 pass, and the opt-in real-data round trip skips. The usage model has 10 tests: uses and frees, the shared line, assets shared across folders, repeats, worlds as their own top-level folder, item and folder sharing lists, deleting together, and 5,000 items with 200 assets each.
  • Hot-loaded into the running game with no errors.

Not verified: the popup itself, the cloud scan and the storage figures. They need the user to press Cloud Storage in game. A finished scan logs "Scanned cloud storage: N items in M folders use X; the cloud reports Y used".

**0.6.0 is built and deployed (5775cd7).** It covers the usage model, the cloud scanner, the popup over the dash and the button next to Copy to Local Storage. **Verified:** - 79 tests: 78 pass, and the opt-in real-data round trip skips. The usage model has 10 tests: uses and frees, the shared line, assets shared across folders, repeats, worlds as their own top-level folder, item and folder sharing lists, deleting together, and 5,000 items with 200 assets each. - Hot-loaded into the running game with no errors. **Not verified:** the popup itself, the cloud scan and the storage figures. They need the user to press **Cloud Storage** in game. A finished scan logs "Scanned cloud storage: N items in M folders use X; the cloud reports Y used".
Author
Owner

Popup confirmed working in game (screenshot: Inventory page with the shared link, a video item and the Avatare folder). The first scan logged "3057 items in 220 folders use 41.1 GB; the cloud reports 36.8 GB used". The items add up to more than the cloud counts, and the cause is unknown. One guess is that the cloud doesn't charge for some assets; that's unverified.

0.7.0 (c19ef7e), as requested:

  • Columns now read unique / shared (the second column shows the shared part, not the total).
  • Item and inventory folder pages have Copy to Local Storage, Move to Local Storage and Delete from Cloud. Move and Delete need a second press within 3 s. The Inventory root gets Copy only, and the Worlds group gets item actions only.
  • Move deletes exactly what was copied, and requires every asset to make it into the package (requireAllAssets), because CollectAssets otherwise skips unfetchable assets quietly.
  • Folder records are deleted deepest first, and only when a fresh cloud listing shows them empty. Links are deleted as links; their targets are never touched.
  • What left the cloud leaves the breakdown, with no rescan needed, and the inventory's open folders stop listing it.

Verified: 80 tests pass (usage model lookups and item removal included), and it hot-loaded with no errors. The delete path is engine-bound and has no unit test; I reviewed it line by line.

Not verified in game yet: copy, move and delete from the popup. Suggested first test: move and delete a throwaway item.

**Popup confirmed working in game** (screenshot: Inventory page with the shared link, a video item and the Avatare folder). The first scan logged "3057 items in 220 folders use 41.1 GB; the cloud reports 36.8 GB used". The items add up to **more** than the cloud counts, and the cause is unknown. One guess is that the cloud doesn't charge for some assets; that's unverified. **0.7.0 (c19ef7e), as requested:** - Columns now read **unique / shared** (the second column shows the shared part, not the total). - Item and inventory folder pages have **Copy to Local Storage**, **Move to Local Storage** and **Delete from Cloud**. Move and Delete need a second press within 3 s. The Inventory root gets Copy only, and the Worlds group gets item actions only. - Move deletes exactly what was copied, and requires every asset to make it into the package (`requireAllAssets`), because `CollectAssets` otherwise skips unfetchable assets quietly. - Folder records are deleted deepest first, and only when a fresh cloud listing shows them empty. Links are deleted as links; their targets are never touched. - What left the cloud leaves the breakdown, with no rescan needed, and the inventory's open folders stop listing it. **Verified:** 80 tests pass (usage model lookups and item removal included), and it hot-loaded with no errors. The delete path is engine-bound and has no unit test; I reviewed it line by line. **Not verified in game yet:** copy, move and delete from the popup. Suggested first test: move and delete a throwaway item.
Author
Owner

Actions in the popup now queue instead of blocking each other (0.7.7, a50747b). One at a time, in press order; queued items already gone from the cloud fail instead of copying twice; Rescan waits for the queue.

Actions in the popup now queue instead of blocking each other (0.7.7, a50747b). One at a time, in press order; queued items already gone from the cloud fail instead of copying twice; Rescan waits for the queue.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kyuubi/ResoLocalStorage#8
No description provided.