Commit Graph

13 Commits

Author SHA1 Message Date
a524f23be2 downloads: track every door and surface them on /analytics
The analytics page could not answer "how many downloads, of which
product". Three of the four download doors recorded nothing: the tRPC
click proxy only left the generic request row, whose path is the raw URL
with the asset buried in `?batch=1&input={"asset_name":...}`, and the S3
file route that serves Sparkle updates and the Nook app logged nothing
at all. The one door that did log (the Nook redirect) kept a private copy
of the logVisit/enrich/flush sequence, under its own path.

All doors now go through trackDownload, which writes one row per event
under /api/downloads/<asset> and flushes it inside the request — a click
is low-volume and serverless is not guaranteed to run the 30s batch
timer after the response. The file route maps its prefix allowlist to
asset keys, so a version bump stays one asset rather than one per
release. getAnalyticsSummary groups those rows into a downloads block and
the freno.me panel renders it under the overview cards.

History is recovered to the degree it exists: the Nook door's rows and
the tRPC clicks still carry enough to derive from (asset name in the URL).
scripts/backfill-downloads.ts inserts those derived rows with a
`backfill-<source id>` primary key and INSERT OR IGNORE, leaving the
originals untouched, so re-running is a no-op. Run against the live table
it added 66 rows: gaze 42, thenook 19, inputhalo 4, lineage 1.

Tests: new backfill suite (derivation, visitor detail carried over,
idempotency, empty history) and summariseDownloads cases; the Nook route
test now pins the canonical path, and the NOOK-337 allowlist audit reads
the map keys instead of quoted strings. Red-checked by stubbing the
downloads block back to zeros — the summary case fails, then passes.
Full suite matches master.

Co-Authored-By: nw-flash <noreply@nw-flash.local>
MISC-48
2026-10-22 12:59:48 -04:00
6f41436591 nook: add an appcast upload helper
The release pipeline had no in-repo path to put a corrected appcast
back on S3 (the backfill of 0.6.0/0.6.2 notes needed one). Reads the
same bucket env the appcast route does; refuses to upload unless every
expected release item is present.

Tests: used for the production backfill; endpoint re-verified after.
2026-10-05 09:43:11 -04:00
082e503d4f nook: per-license device caps + grant CLI for free licenses 2026-08-27 09:16:31 -04:00
9ae1b8a2e5 nook: commit license keygen script (blind-spot scripts/ ignore) 2026-08-27 08:55:45 -04:00
898c891bd5 chore: remediate pygienium audit findings
Dead code: 77 verified-unused exports, files (BackArrow, MenuBars,
cookies.ts, db/create.ts, schemas/comment.ts, security-headers.ts) and
12 unused dependencies removed
Comments: ~370 RESTATE comments stripped across 53 files; 2 verbose
blocks tightened; dead commented-out config removed
Complexity: bulkUpsert extracted into 11 per-entity helpers (CCN 156->~10);
login formHandler split into 3 submitters (CCN 63->~5); account page render
split into 8 section components (CCN 40); updatePost SQL builder rebuilt;
assert*Owned consolidated behind generic assertOwnedBy
Defensive guards: 4 redundant rethrow/nullish guards removed
2026-08-11 13:36:18 -04:00
37ed5170ed docs: add Sparkle appcast dual-host support documentation
- Add architecture overview for dual-host URL routing (freno.me and *.freno.me)
- Document Vercel JSON rewrite strategy for subdomain pass-through
- Include task completion summary with verification results
- Add SUFeedURL migration guide for new native builds
- Add shell script for verifying dual-host endpoint functionality
2026-07-23 10:55:35 -04:00
77f84c47b1 docs: add subdomain routing reference to AGENTS.md and verification script
- Add Subdomain Routing section to AGENTS.md with route placement, site context,
  API routing, and auth boundary guidance for future tasks
- Add scripts/verify-subdomains.sh for post-deployment verification of DNS, HTTPS,
  appcast regression, and SSL certificates
2026-07-23 09:29:26 -04:00
8f241ce611 adjust email/pass addition flow, blog ttl extended 2026-01-07 21:21:27 -05:00
35259eac8b move 2026-01-04 22:02:56 -05:00
8513651a2e expand testing 2026-01-04 21:22:02 -05:00
111712e969 testing improvements 2026-01-04 12:02:18 -05:00
a772eb9363 Add blog post to performance test suite 2026-01-04 11:41:40 -05:00
68073b4f17 Optimize Mermaid and blog component loading with lazy imports 2026-01-04 11:37:39 -05:00