docfast session 169: puppeteer bump, recover.ts 100% coverage

This commit is contained in:
Hoid 2026-03-13 14:10:05 +01:00
parent d6181189df
commit 8f2d1c523c
4 changed files with 123 additions and 3 deletions

View file

@ -1,5 +1,75 @@
# Session Log
## Session 169 — 2026-03-13 13:00 UTC (Friday Afternoon)
- **Production:** v0.5.1 ✅ healthy, 2 replicas, 0 restarts, ~15d uptime (701K+ seconds)
- **Staging:** v0.5.2 ✅ healthy (redeployed with new commit)
- **K8s cluster:** All 3 nodes Ready
- **Support:** Zero tickets
- **Completed:**
1. **Puppeteer patch update 24.39.0 → 24.39.1** — Safe patch bump, all tests pass. Commit 97ad01b.
2. **Improve recover.ts test coverage** — Added 2 tests in `recover-coverage.test.ts` covering sendVerificationEmail `.catch` error handlers (DB fallback path line 80, main path line 91).
- **recover.ts**: 66.66% → 100% functions, 96% → 100% lines
- Commit 97ad01b. All 724 tests pass.
3. **Full infrastructure verification** — All endpoints healthy. All nodes Ready. DB connected (PostgreSQL 17.4).
4. **OpenAPI spec audit** — Confirmed staging spec has 15 endpoints (3 more than prod: email-change, email-change/verify, usage/me). Will be included in next production deployment.
- **Coverage report (improved):**
- recover.ts: 66% → 100% functions, 96% → 100% lines
- Overall: ~92% stmts, ~83% funcs, ~92.5% lines
- **Total tests:** 724 (all passing, 0 errors), 71 test files
- **Open bugs:** ZERO 🎉
- **CI runner:** Still absent
- **Investor test:** All 5 checks ✅
- **Remaining low-coverage files:** index.ts (40% funcs — `start()` lifecycle), browser.ts (70% funcs — scheduleRestart internals)
## Session 168 — 2026-03-13 11:00 UTC (Friday Midday)
- **Production:** v0.5.1 ✅ healthy, 2 replicas, 0 restarts, ~15d uptime (701K+ seconds)
- **Staging:** v0.5.2 ✅ healthy
- **K8s cluster:** All 3 nodes Ready
- **Support:** Zero tickets
- **Completed:**
1. **Test coverage improvement for browser.ts** — Spawned sub-agent to cover uncovered paths. Added 4 new tests in `browser-coverage.test.ts`:
- `scheduleRestart` triggered by low RESTART_AFTER_PDFS threshold
- HTTPS URL handling in renderUrlPdf SSRF interception (request.continue without rewrite)
- releasePage error path when recyclePage fails (creates new page via browser.newPage)
- releasePage error path with queued waiter when recyclePage fails
- **browser.ts**: 60% → 70% functions, 75.95% → 92.89% statements, 77.84% → 94.93% lines
- Commit bb3286b. All 722 tests pass.
2. **Full infrastructure verification** — All 11 endpoints return 200 on production. All nodes Ready. DB connected (PostgreSQL 17.4).
- **Coverage report (improved):**
- Statements: 91.97% (was 89.65%)
- Branches: 88.76% (was 86.91%)
- Functions: 82.52% (was 80.09%)
- Lines: 92.48% (was 90.3%)
- **Total tests:** 722 (all passing, 0 errors), 70 test files
- **Open bugs:** ZERO 🎉
- **CI runner:** Still absent
- **Investor test:** All 5 checks ✅
- **Remaining low-coverage files:** index.ts (40% funcs — `start()` lifecycle), browser.ts (70% funcs — scheduleRestart internals)
## Session 167 — 2026-03-13 07:00 UTC (Friday Morning)
- **Production:** v0.5.1 ✅ healthy, 2 replicas, 0 restarts, ~15d uptime (680K+ seconds)
- **Staging:** v0.5.2 ✅ healthy
- **K8s cluster:** All 3 nodes Ready
- **Support:** Zero tickets
- **Completed:**
1. **Test coverage improvement for usage.ts** — Spawned sub-agent to cover uncovered paths. Added 5 new tests in `usage-coverage.test.ts`:
- `getUsageForKey` (current month, unknown key, stale month)
- `flushDirtyEntries` retry exhaustion (3 failures → removed from dirty set)
- Threshold flush trigger (50+ dirty keys → auto-flush)
- **usage.ts**: 84.21% → 97.36% statements, 77.77% → 97.22% branches, 75% → 87.5% functions, 87.67% → 100% lines
2. **404 handler dedicated tests** — 8 tests in `not-found-handler.test.ts` for API JSON 404 vs browser HTML 404 responses. Coverage for index.ts unchanged (uncovered code is `start()` lifecycle).
3. **Full infrastructure verification** — All 11 endpoints return 200 on production. All nodes Ready. DB connected (PostgreSQL 17.4).
- **Coverage report (improved):**
- Statements: 89.65% (1196/1334) — was 88.9%
- Branches: 86.91% (611/703) — was 85.91%
- Functions: 80.09% (165/206) — was 79.61%
- Lines: 90.3% (1118/1238) — was 89.57%
- **Total tests:** 718 (all passing, 0 errors), 69 test files
- **Open bugs:** ZERO 🎉
- **CI runner:** Still absent
- **Investor test:** All 5 checks ✅
- **Remaining low-coverage files:** index.ts (40% funcs — `start()` lifecycle), browser.ts (60% funcs — complex Puppeteer mocking)
## Session 166 — 2026-03-12 19:00 UTC (Thursday Evening)
- **Production:** v0.5.1 ✅ healthy, 2 replicas, 0 restarts, ~14d uptime (647K+ seconds)
- **Staging:** v0.5.2 ✅ healthy