Spaces overview shows the file list's footer when entered straight from Administration #817

Closed
opened 2026-09-28 18:11:01 +00:00 by Cordy · 2 comments
Owner

Found on Bao (v0.6.306) while mocking #801.

Repro:

  1. Fresh page load straight into the admin view (e.g. /#admin/storage/limits).
  2. Go to Spaces (#view/spacesov).
  3. The files footer #listfoot ("2 items — 0 files, 2 folders · 0 B") is visible (hidden=false, display:flex) above the overview's search box, on top of the overview's own footer.

Control: Personal (#/home) → Spaces hides it correctly (hidden=true).

Likely cause: the files view hides #listfoot when it hands over to the overview. The admin → overview route never passed through the files view, so the footer that the boot-time listing filled stays shown.

Fix direction: openSpacesView (or setView for any non-files view) hides #listfoot itself, instead of relying on the route it came from. Add a Node pin, plus a live check of the admin → Spaces route.

Found on Bao (v0.6.306) while mocking #801. **Repro:** 1. Fresh page load straight into the admin view (e.g. `/#admin/storage/limits`). 2. Go to Spaces (`#view/spacesov`). 3. The files footer `#listfoot` ("2 items — 0 files, 2 folders · 0 B") is visible (`hidden=false`, `display:flex`) above the overview's search box, on top of the overview's own footer. **Control:** Personal (`#/home`) → Spaces hides it correctly (`hidden=true`). **Likely cause:** the files view hides `#listfoot` when it hands over to the overview. The admin → overview route never passed through the files view, so the footer that the boot-time listing filled stays shown. **Fix direction:** `openSpacesView` (or `setView` for any non-files view) hides `#listfoot` itself, instead of relying on the route it came from. Add a Node pin, plus a live check of the admin → Spaces route.
Author
Owner

Root cause (systematic debugging; the issue's first guess was wrong)

I instrumented setView / load / lfSummary / renderRows live on Bao and reproduced (fresh load on #admin/storage/limits → #view/spacesov):

>closeAdmin()            leaving admin …
>load(/home)             … starts restoring the previous folder (async fetch)
>setView(files)
>openSpacesView()        the router immediately opens the overview
>setView(spacesov)       footer hidden  [lf=H]   ← setView already does the right thing
>lfSummary(…)            the /home fetch lands NOW and re-shows the footer [lf=SHOWN]
>renderRows(…)           … and renders rows, overwrites currentItems, read-only state, space header

So setView is fine. The problem is that load() has no staleness guard after its fetch. Other async views have one (if (seq !== spacesovSeq || currentView !== "spacesov") return;). The same gap lets two quick folder clicks land out of order.

Fix (9 lines, load() only): a loadSeq ticket. After the fetch, and in the error path, the listing is dropped unless it is still the latest and the files view is still showing.

Test: qa817 runs the real load() source in a Node vm sandbox with stubs and a fetch whose timing the test controls. RED on the three bug cases (listing after leaving the view, older-slower-last, late error), green after; the control case (a current listing renders) passes before and after.

Callers: the four await load(...) callers that then look up currentItems now simply find nothing if the user moved on. Before, they opened details over the new view.

## Root cause (systematic debugging; the issue's first guess was wrong) I instrumented `setView` / `load` / `lfSummary` / `renderRows` live on Bao and reproduced (fresh load on `#admin/storage/limits` → `#view/spacesov`): ``` >closeAdmin() leaving admin … >load(/home) … starts restoring the previous folder (async fetch) >setView(files) >openSpacesView() the router immediately opens the overview >setView(spacesov) footer hidden [lf=H] ← setView already does the right thing >lfSummary(…) the /home fetch lands NOW and re-shows the footer [lf=SHOWN] >renderRows(…) … and renders rows, overwrites currentItems, read-only state, space header ``` So `setView` is fine. The problem is that `load()` has **no staleness guard** after its fetch. Other async views have one (`if (seq !== spacesovSeq || currentView !== "spacesov") return;`). The same gap lets two quick folder clicks land out of order. **Fix (9 lines, `load()` only):** a `loadSeq` ticket. After the fetch, and in the error path, the listing is dropped unless it is still the latest and the files view is still showing. **Test:** `qa817` runs the real `load()` source in a Node `vm` sandbox with stubs and a fetch whose timing the test controls. RED on the three bug cases (listing after leaving the view, older-slower-last, late error), green after; the control case (a current listing renders) passes before and after. **Callers:** the four `await load(...)` callers that then look up `currentItems` now simply find nothing if the user moved on. Before, they opened details over the new view.
Cordy closed this issue 2026-09-29 16:59:39 +00:00
Author
Owner

Shipped in v0.6.309 (PR #819, CI green, web 313/313). Verified live on Bao with the same instrumentation (fresh load on #admin/storage/limits → #view/spacesov):

>closeAdmin()  >load(/)  >setView(files)  >openSpacesView()  >setView(spacesov)
<load done     ← the late listing returned WITHOUT lfSummary/renderRows

The footer stays hidden (lf=H throughout) and the overview renders clean.

Shipped in **v0.6.309** (PR #819, CI green, web 313/313). Verified live on Bao with the same instrumentation (fresh load on `#admin/storage/limits` → `#view/spacesov`): ``` >closeAdmin() >load(/) >setView(files) >openSpacesView() >setView(spacesov) <load done ← the late listing returned WITHOUT lfSummary/renderRows ``` The footer stays hidden (`lf=H` throughout) and the overview renders clean.
Sign in to join this conversation.
No labels
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: Cordy/Cairn#817
No description provided.