Skip to content

Fix audit snapshots, landing feedback forms, PDF/EPS errors, gradient on eyes - #1

Merged
CompleteDotTech merged 1 commit into
mainfrom
fix/audit-forms-export
Oct 22, 2026
Merged

CompleteDotTech merged 1 commit into
mainfrom
fix/audit-forms-export

Conversation

@CompleteDotTech

Copy link
Copy Markdown
Contributor

Summary

  • Audit log overwritten by edits: addAudit (src/server/store.ts) stored a live reference to the QR record, and PATCH /api/qr-codes/:id mutates that record in place, so the created entry (and earlier updated entries) were rewritten by every later edit. It now structuredClones previous/next when the event is recorded.
  • Rating/feedback submissions thrown away: the landing-page form posts application/x-www-form-urlencoded, but the server only parsed JSON, so req.body was undefined, nothing useful was stored, and the response was still { ok: true }. POST /api/landing/:id/feedback now parses both urlencoded and JSON bodies, validates name/message with zod, returns 400 for empty or unparseable bodies, only accepts rating/feedback codes, and sends form posts an HTML confirmation or error page (JSON clients still get JSON).
  • PDF/EPS export returned 500: the renderer now throws UnsupportedFormatError (status 400). /api/qr-codes/:id/render also validates file, so unknown values like gif no longer fall through to PNG.
  • "Gradient on eyes" had no effect: when it's checked, eye frames and balls now use the body gradient. Gradients also use gradientUnits="userSpaceOnUse", so one gradient spans the whole code. Before, it restarted inside every module. This is a visible change for templates that use gradients (Rain, Jungle, Mosaic, Coffee, Ninja).

Test plan

  • tsc --noEmit
  • vitest run: 34 passed (6 new regression tests: audit snapshot, urlencoded and JSON feedback, empty/plain-text feedback rejected, PDF/EPS/invalid format returns 400, gradient on/off)
  • vite build
  • scripts/qr-smoke.ts
  • No real YOURLS server contacted (tests run without YOURLS env, using the dev fallback)

🤖 Generated with Claude Code

…on eyes

- Audit log: addAudit now structuredClones previous/next so in-place edits
  in PATCH /api/qr-codes/:id no longer rewrite the "created" entry (or
  earlier "updated" entries).
- Landing feedback: the rating/feedback form posts urlencoded, but only
  JSON was parsed, so submissions were stored as undefined and the API
  still answered { ok: true }. The route now parses urlencoded and JSON,
  validates name/message, rejects empty or unparseable bodies with 400,
  only accepts rating/feedback codes, and answers form posts with an HTML
  confirmation or error page.
- Export: PDF/EPS requests return 400 with a clear message instead of
  500; the /api/qr-codes/:id/render route now validates the file param.
- Renderer: "Gradient on eyes" now applies the body gradient to eye frames
  and balls. Gradients use userSpaceOnUse so one gradient spans the whole
  code instead of restarting inside every module.
- Regression tests for each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T04:44:19.083051Z 57e2196 PR opened
🔒 Security Review ✅ Completed 2026-10-22T04:45:40.788388Z 57e2196 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@CompleteDotTech
CompleteDotTech merged commit d354ae9 into main Oct 22, 2026
4 checks passed
CompleteDotTech added a commit that referenced this pull request Oct 22, 2026
The previous commit was edited on Windows and saved with CRLF, which turned
it into a whole-file diff. Whitespace only; no content changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CompleteDotTech added a commit that referenced this pull request Oct 22, 2026
Restore LF line endings in files touched by #1
@CompleteDotTech
CompleteDotTech deleted the fix/audit-forms-export branch October 22, 2026 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant