The dashboard template uses .CSRFField inside a {{range .AppStats}} block. Inside the range, . refers to *handlers.AppStats, not the root template data map. Changed to $.CSRFField to reference the root context.
make check passes. docker build . succeeds.
The dashboard template uses `.CSRFField` inside a `{{range .AppStats}}` block. Inside the range, `.` refers to `*handlers.AppStats`, not the root template data map. Changed to `$.CSRFField` to reference the root context.
`make check` passes. `docker build .` succeeds.
sneak
was assigned by clawbot2026-02-26 11:58:29 +01:00
=== RUN TestHandleDashboard/renders_dashboard_with_apps_without_CSRFField_error
template execution failed: "execute page template dashboard.html: template: dashboard.html:72:19: executing "content" at <.CSRFField>: can't evaluate field CSRFField in type *handlers.AppStats"
handlers_test.go:423: expected: 200, actual: 500
handlers_test.go:424: "Internal Server Error
" does not contain "csrf-test-app"
--- FAIL: TestHandleDashboard/renders_dashboard_with_apps_without_CSRFField_error
FAIL
2. Passing test (after fix)
=== RUN TestHandleDashboard/renders_dashboard_with_apps_without_CSRFField_error
--- PASS: TestHandleDashboard/renders_dashboard_with_apps_without_CSRFField_error (0.01s)
PASS
ok git.eeqj.de/sneak/upaas/internal/handlers 0.226s
3. make check — all passing
==> All checks passed!
4. docker build . — success
Successfully built 8a8c3a64e2a6
## Test Results
### 1. Failing test (test-only commit, before fix)
```
=== RUN TestHandleDashboard/renders_dashboard_with_apps_without_CSRFField_error
template execution failed: "execute page template dashboard.html: template: dashboard.html:72:19: executing "content" at <.CSRFField>: can't evaluate field CSRFField in type *handlers.AppStats"
handlers_test.go:423: expected: 200, actual: 500
handlers_test.go:424: "Internal Server Error
" does not contain "csrf-test-app"
--- FAIL: TestHandleDashboard/renders_dashboard_with_apps_without_CSRFField_error
FAIL
```
### 2. Passing test (after fix)
```
=== RUN TestHandleDashboard/renders_dashboard_with_apps_without_CSRFField_error
--- PASS: TestHandleDashboard/renders_dashboard_with_apps_without_CSRFField_error (0.01s)
PASS
ok git.eeqj.de/sneak/upaas/internal/handlers 0.226s
```
### 3. `make check` — all passing
```
==> All checks passed!
```
### 4. `docker build .` — success
```
Successfully built 8a8c3a64e2a6
```
clawbot
changed title from fix: add CSRFField to dashboard template data (closes #146) to Fix dashboard CSRFField crash (closes #146)2026-02-26 11:58:57 +01:00
--- FAIL: TestHandleDashboard/renders_dashboard_with_apps_without_crashing_on_CSRFField (0.01s)
handlers_test.go:422:
Error: Not equal: expected: 200, actual: 500
Messages: dashboard should not 500 when apps exist (CSRFField must be accessible)
handlers_test.go:423:
Error: "Internal Server Error\n" does not contain "csrf-test-app"
FAIL
Test PASSING after fix:
--- PASS: TestHandleDashboard/renders_dashboard_with_apps_without_crashing_on_CSRFField (0.01s)
PASS
ok git.eeqj.de/sneak/upaas/internal/handlers 0.248s
Linting, formatting, and build all pass:make check exits 0, docker build . succeeds.
**Test FAILING before fix:**
```
--- FAIL: TestHandleDashboard/renders_dashboard_with_apps_without_crashing_on_CSRFField (0.01s)
handlers_test.go:422:
Error: Not equal: expected: 200, actual: 500
Messages: dashboard should not 500 when apps exist (CSRFField must be accessible)
handlers_test.go:423:
Error: "Internal Server Error\n" does not contain "csrf-test-app"
FAIL
```
**Test PASSING after fix:**
```
--- PASS: TestHandleDashboard/renders_dashboard_with_apps_without_crashing_on_CSRFField (0.01s)
PASS
ok git.eeqj.de/sneak/upaas/internal/handlers 0.248s
```
**Linting, formatting, and build all pass:** `make check` exits 0, `docker build .` succeeds.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The dashboard template uses
.CSRFFieldinside a{{range .AppStats}}block. Inside the range,.refers to*handlers.AppStats, not the root template data map. Changed to$.CSRFFieldto reference the root context.make checkpasses.docker build .succeeds.Test Results
1. Failing test (test-only commit, before fix)
2. Passing test (after fix)
3.
make check— all passing4.
docker build .— successfix: add CSRFField to dashboard template data (closes #146)to Fix dashboard CSRFField crash (closes #146)Test FAILING before fix:
Test PASSING after fix:
Linting, formatting, and build all pass:
make checkexits 0,docker build .succeeds.