BLOCKER: All template-rendered pages return empty content #18
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/webhooker#18
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
Bug
All server-rendered HTML pages (index, login, sources list, source detail, edit, logs, profile) return HTTP 200 with an empty body (1 byte: newline). The web UI is completely non-functional.
Root Cause
In
internal/handlers/handlers.go,parsePageTemplate()uses:Go's
template.ParseFSnames the resulting template set after the first file parsed (htmlheader.html). Whentmpl.Execute(w, data)is called inrenderTemplate(), it executes the root template — which ishtmlheader.html. Since that file consists entirely of a{{define "htmlheader"}}...{{end}}block, the root template is empty.The page-specific templates (e.g.,
source_detail.html) have:The
{{template "base" .}}invocation never executes becauseExecute()runs the (empty) root template, not the page template.Evidence
Testing with curl:
The healthcheck (
/.well-known/healthcheck) still works because it usesrespondJSON()directly, not template rendering.Fix
Two options:
Option A (simpler): Change
renderTemplate()to useExecuteTemplatewith the page template name:But this requires page templates to use the file's own name rather than
{{template "base" .}}.Option B (recommended): Restructure so the base template is the root. Parse the page file first so it becomes the root template:
Since page templates start with
{{template "base" .}}(a top-level action), executing the root template will invoke the base template, which in turn uses the definedcontentandtitleblocks.Impact
The entire web management UI is blank. Users cannot see or interact with any page. Only the JSON healthcheck endpoint works. This blocks the 1.0 release.