Fix #172: tab fetch uses resolved revision #173

Merged
crueber merged 1 commit from fix/issue-172 into main 2026-09-06 15:32:39 +00:00
Owner

ACTUAL ROOT CAUSE (verified in code): DocTabs built its blob revision as t().sha ?? t().ref (web/src/pages/Tree.jsx). Any tree payload without sha interpolated a UI display string — the full ref name, e.g. refs/heads/main — into the blob route's single-segment {rev}; the router splits it (rev=refs, mangled path), resolve fails, the fetch 404s, and the sha-addressed entry (never revalidated) sits on loading... forever on every tab. The reported SHA:...:BLOB:... 'revision' is the same misread class as #150 (documented in 12_web_ui.md): there is NO uppercase-key source — the tray chip renders the useData key verbatim inside .chip, which carries Tailwind uppercase, so the key DISPLAYS uppercased. The fetch itself always carried the lowercase sha. Fix: Tree.jsx passes rev={t().sha} (no ref fallback); cache key + fetcher go through the pure docFetchArgs gate (40-lowercase-hex sha + per-segment-encoded path, null = do not fetch, no tray spam). Same endpoint/key shape (still shared with the blob page), lazy-per-tab fetching and #171 encoding unchanged. No backend/SDK/styling change; no new deps. Tests: node --test web/test/unit/*.test.js 361/361 green (incl. 2 new regression tests pinning fetch args). Verification: node tests + code reasoning + esbuild syntax check only — NO browser drive (per task constraints). Fixes #172.

ACTUAL ROOT CAUSE (verified in code): DocTabs built its blob revision as `t().sha ?? t().ref` (web/src/pages/Tree.jsx). Any tree payload without `sha` interpolated a UI display string — the full ref name, e.g. `refs/heads/main` — into the blob route's single-segment `{rev}`; the router splits it (`rev=refs`, mangled path), resolve fails, the fetch 404s, and the sha-addressed entry (never revalidated) sits on loading... forever on every tab. The reported `SHA:...:BLOB:...` 'revision' is the same misread class as #150 (documented in 12_web_ui.md): there is NO uppercase-key source — the tray chip renders the useData key verbatim inside `.chip`, which carries Tailwind `uppercase`, so the key DISPLAYS uppercased. The fetch itself always carried the lowercase sha. Fix: Tree.jsx passes `rev={t().sha}` (no ref fallback); cache key + fetcher go through the pure `docFetchArgs` gate (40-lowercase-hex sha + per-segment-encoded path, null = do not fetch, no tray spam). Same endpoint/key shape (still shared with the blob page), lazy-per-tab fetching and #171 encoding unchanged. No backend/SDK/styling change; no new deps. Tests: node --test web/test/unit/*.test.js 361/361 green (incl. 2 new regression tests pinning fetch args). Verification: node tests + code reasoning + esbuild syntax check only — NO browser drive (per task constraints). Fixes #172.
DocTabs built its blob revision as t().sha ?? t().ref: any tree
payload without sha interpolated a UI display string (full ref
name) into the blob route's single-segment {rev}, splitting the
route and 404ing every tab body onto loading... forever. Tree.jsx
now passes rev={t().sha} and both key and fetcher go through the
pure docFetchArgs gate (40-hex sha + per-segment path, null =
do not fetch). Regression tests pin the fetch args; decision
appended to 12_web_ui.md.
Sign in to join this conversation.
No description provided.