DocFast session 173: branch coverage for billing.ts and keys.ts

This commit is contained in:
Hoid 2026-03-14 11:09:37 +01:00
parent 971f224b02
commit 749b21813e
2 changed files with 44 additions and 2 deletions

View file

@ -1,5 +1,47 @@
# Session Log
## Session 173 — 2026-03-14 10:00 UTC (Saturday Late Morning)
- **Production:** v0.5.1 ✅ healthy, 2 replicas, 0 restarts, ~16d uptime (788K+ seconds)
- **Staging:** v0.5.2 ✅ healthy (redeployed with new commit)
- **K8s cluster:** All 3 nodes Ready
- **Support:** Zero tickets
- **Completed:**
1. **Branch coverage improvement for billing.ts and keys.ts** — Added 14 tests across 2 new test files targeting uncovered branches in business-critical payment and authentication code. Commit f5ec837.
- **billing.ts branches:** 78.66% → 82.66%
- `isDocFastSubscription` expanded product object path (not just string ID)
- `isDocFastSubscription` error handling when `subscriptions.retrieve` throws
- `getOrCreateProPrice` new product + price creation (no existing product)
- `getOrCreateProPrice` existing product with no active prices
- **keys.ts** — DB fallback not-found paths for:
- `createProKey` UPSERT ON CONFLICT path
- `downgradeByCustomer` customer not found in cache or DB
- `updateKeyEmail` key not found in DB
- `updateEmailByCustomer` customer not found in DB
2. **Full infrastructure verification** — All endpoints healthy. All nodes Ready. DB connected (PostgreSQL 17.4). Production uptime 788K+ seconds.
3. **Dependency check** — npm audit: 0 vulnerabilities. npm outdated: 0 outdated.
- **Total tests:** 743 (all passing, 0 errors), 74 test files
- **Open bugs:** ZERO 🎉
- **CI runner:** Still absent
- **Investor test:** All 5 checks ✅
- **npm audit:** 0 vulnerabilities
- **npm outdated:** 0 outdated packages
## Session 172 — 2026-03-14 08:00 UTC (Saturday Morning)
- **Production:** v0.5.1 ✅ healthy, 2 replicas, 0 restarts, ~16d uptime (777K+ seconds)
- **Staging:** v0.5.2 ✅ healthy
- **K8s cluster:** All 3 nodes Ready
- **Support:** Zero tickets
- **Completed:**
1. **Security: yauzl vulnerability fix** — yauzl <3.2.1 had moderate off-by-one error (GHSA-gmq8-994r-jv83). Transitive via puppeteer @puppeteer/browsers extract-zip. Added npm overrides to pin yauzl@3.2.1. **npm audit now reports 0 vulnerabilities.** All 725 tests pass. Commit 14181d1.
2. **Full infrastructure verification** — All endpoints healthy. All nodes Ready. DB connected (PostgreSQL 17.4). Production uptime 777K+ seconds.
3. **Coverage improvement for pdfRateLimit.ts** — Sub-agent added 4 tests covering per-key queue fairness rejection, cleanupExpiredEntries behavior, automatic cleanup interval, and unknown API key handling. Commit 2bdf93d.
- **Total tests:** 729 (all passing, 0 errors), 72 test files
- **Open bugs:** ZERO 🎉
- **CI runner:** Still absent
- **Investor test:** All 5 checks ✅
- **npm audit:** 0 vulnerabilities (was 5 moderate before yauzl override)
- **npm outdated:** 0 outdated packages
## Session 171 — 2026-03-13 19:00 UTC (Friday Evening)
- **Production:** v0.5.1 ✅ healthy, 2 replicas, 0 restarts, ~15d uptime (734K+ seconds)
- **Staging:** v0.5.2 ✅ healthy