Fix #203: tree-fetch failure behind healthy backend #204
No reviewers
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub!204
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-203"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Root cause (proven live, not cache poisoning): on a cold serving copy (fresh restart/recreate: refs synced, objects/pack empty), every sha-addressed render 404s. The tree handler re-resolves the full head sha via
git rev-parsein the empty copy → miss →not found: <sha>(bind_wal.go Resolve fallback arm, via notFoundOr — the exact 51-byte body; the issue's 'no server code emits this shape' missed the resolve arm). The UI's resolve→sha flow never issues a ref-named request, so nothing ever triggers the serve sync that would materialize the packs — every visit re-toasts and the page sticks on 'loading tree…'.CAPTURED failing request (real browser via CDP, fresh profile, own cold server built from origin/main):
GET /acme/demo/api/tree/8de1c9a5c9acb458a73a4fee8ac2fe81402d8ed3→ 404not found: 8de1c9a5c9acb458a73a4fee8ac2fe81402d8ed3, served from NETWORK (fromDiskCache=false), response carries NO Cache-Control (Date only) — a poisoned immutable entry cannot replay this; every reload re-fetches live.GET /acme/demo/api/resolve→ 200 with the same sha (refs healthy).GET /acme/demo/api/tree/main→ 200 and HEALED the copy (materialize fetched the packs — the objects were in the bucket all along).Fix:
walView.Resolveserve-syncs once and retriesrev-parseon a full-sha (40/64 hex) miss before 404ing (docs/go/07_api.md §9.3 step 3 amended + Decisions entry). Hot path unchanged — the retry runs only on rev-parse miss; genuinely-missing shas keep the exactnot found: <seg>404. No frontend change, no new deps.Tests: new
TestWalResolveColdCopyRetriesServe(cold-copy miss shape + serve-sync attempted + heal-to-commit + coldGET …/tree/<sha>→ 200); verified it FAILS pre-fix (calls = [refs]).go vetclean,go test ./internal/api/ -racegreen, coverage 95.4% (≥95 gate holds). Browser proof post-fix on a cold server: repo opens clean, tree renders, empty tray, zero console errors, both themes (dark default + toggled light).Follow-up found (NOT in this PR, will file separately): the push path writes manifest PackRef checksums WITH the
pack-infix (server newLocalPackkeeps it via TrimSuffix-only; same in repoimport/task.go + cmd/walhub/ops.go), violating thewal/<bare-hex>.packcontract (docs/go/02 + Rust §5.1) — live bucket showspack-<hex>andpack-pack-<hex>duplicates piling up in manifests.