Repository navigation
#74: Tree totals from summary.totals.bytes + 4s summary timeout on partials - #75
Merged
Merged
Conversation
Deploying nemar-website with
|
| Latest commit: |
f87833e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e8878d00.nemar-website.pages.dev |
| Branch Preview URL: | https://feature-issue-74-hotfix-tree.nemar-website.pages.dev |
Two user-visible fixes that both touch tree.ts. Filed and motivated in #74; per-file sizes (the other "0 B" symptom) stay out of scope and live in #73 + nemar-cli#635 (schema 1.2 path_sizes). - Panel header on /dataset/<id> read "X top-level entries · 0 B total" for every dataset because buildTreeFromPaths synthesized zero-size manifest entries. summary.json already carries an accurate summary.totals.bytes (e.g., 168_778_508_210 = ~157 GB on on005512); thread it through a new optional rootTotalSize parameter on buildTreeFromPaths so the header reports it correctly. Per-file rows still display 0 B (waiting on 1.2). - /api/dataset/<id>/{readme,tree} both fetched summary.json with timeoutMs: 1_500. HBN-sized summary.json is 400-750 KB; on a cold CF isolate the 1.5s ceiling triggered the manifest / no-manifest fallback chain on first visit ("Manifest unavailable" + "No description available" on /dataset/on005510, on005511, on005512 cold; takes 2-3 refreshes to warm the data.nemar.org edge entry, after which it sticks for s-maxage=86400). Bump summary fetch to 4s in both endpoints. Landing stays at 1.5s (tiny payload, slow landing usually = dataset doesn't exist). 403/403 tests pass (+2 new for the rootTotalSize override branch and its back-compat zero-default). Closes #74
neuromechanist
force-pushed
the
feature/issue-74-hotfix-tree-totals
branch
from
May 27, 2026 13:05
b01a06a to
f87833e
Compare
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two user-visible regressions on
https://ww2.nemar.org/dataset/<id>for HBN-sized datasets. Both touchtree.ts, both are small, both land here together.1. Panel header read "0 B total" for every dataset
render-tree.tsdisplaysroot.totalSizefor the header line ("N top-level entries · X B total"). On the schema 1.1 summary fast path,buildTreeFromPathssynthesizes zero-size manifest entries (intentional — summary.json deliberately drops per-entry sizes to keep the payload small), soroot.totalSizepropagated as 0. Meanwhilesummary.totals.byteswas already populated and accurate (e.g., on005512 reports168778508210for 168 GB).Fix: add an optional
rootTotalSizeparameter tobuildTreeFromPaths, passsummary.totals?.bytesfromtree.ts. Per-file "0 B" rows are NOT in scope — they need schema 1.2 (filed as nemar-cli#635 + #73).2. Cold-isolate first-visit timeouts on the partial endpoints
readme.tsandtree.tsboth fetchedsummary.jsonwithtimeoutMs: 1_500. HBN-sized summary.json is 400-750 KB; on a cold CF isolate the 1.5s ceiling was triggering the manifest / no-manifest fallback chain on first visit, surfacing as "Manifest unavailable" and "No description available" placeholders. User report 2026-05-27 confirmed it across on005510 / on005511 / on005512: 2-3 refresh cycles before things load, after which data.nemar.org'ss-maxage=86400keeps the entry warm for 24 h on that PoP.Fix: bump the summary fetch to 4 s on both endpoints (matches the metadata fetch's existing default). Landing stays at 1.5 s — landing is a tiny payload, and a slow landing usually means dataset-doesn't-exist where a fast 404 is the right move.
Closes #74
Files touched
src/lib/bids-tree.ts—buildTreeFromPathsgains the additiverootTotalSize?: numberparameter; existing callers (which pass no second argument) unaffected.src/pages/api/dataset/[id]/tree.ts— summary timeout 1.5 → 4 s; call site threadssummary.totals?.bytesthrough the new parameter.src/pages/api/dataset/[id]/readme.ts— summary timeout 1.5 → 4 s (parity with tree.ts; same cold-isolate path triggers Step 0.5's failure-fallback).src/lib/bids-tree.test.ts— 2 new tests for the override branch + the no-override back-compat default.Test plan
bun run typecheck— 0 errors / 0 warnings / 0 hintsbun run lint— biome cleanbun run test— 403/403 (was 401; +2 inbids-tree.test.ts)bun run build— astro build clean/dataset/on005512reads "157 GB total" (or similar) instead of "0 B total"Out of scope (filed separately, intentionally)
summary.path_sizes. Filed as nemar-cli#635 (backend) and Consume summary.path_sizes for per-file sizes in BIDS tree #73 (consumer).