[HIGH] /new Create button does nothing: $("#iscan") null crash in create() — pre-existing since PR #129 merge #163
Notifications
Total Time Spent: 1 hour 20 minutes
fen
1 hour 20 minutes
No due date set.
Dependencies
No dependencies set.
Reference: poslop/palette#163
Reference in New Issue
Block a user
Repro (headless chromium, palette-dev, commit
5a227e2/ image 1200177b3d1c):Cause (from CDP console + code reading): internal/web/static/new.js line ~155 does
if ($("iscan").checked) return createCan();but the served /new page has no #iscan element.$(...)(getElementById) returns null and create() throws TypeError before the fetch.History: merge
f1b5dd0(PR #126,8104cdb) removed the Can contents section incl. #iscan from new.html, but the inline script still referenced it harmlessly (throw inside a listener, create still worked). Merge22c6624(PR #129, #38 file attachments) then moved theif ($(iscan).checked)guard INTO create() itself, so every create now crashes. Pre-existing on dev before #159; reproduced identically on the pre-merge build.Suggested fix: delete the iscan/createCan dead path from new.js (or restore the checkbox). Server-side POST /api/pastes works fine (201 verified) — UI-only breakage. Found during QA of #159; CSP change itself is clean and deployed.
QA verified on a fresh local build of PR #164 (
0787871): go vet clean, go test ./... all pass, /new served without #iscan, JS no longer references iscan/createCan, and POST /api/pastes returns 201 with the create() payload shape. Original repro (click Create, no request fired) no longer reproduces. Merging.QA passed: fix-163 rebased onto dev, merged as PR #164 (merge commit
93fea6a). CI test+docker success; deployed to palette-dev (image digest ec4f8fe2). Rendered /new verified: id="create" button present, no stale iscan/createCan refs in served new.js, no CSP console violations. Live POST /api/pastes created paste g4s83b and re-read OK. Version label shows dev.