← back to Dw Photo Capture
5x/REPORT.md
74 lines
# /5x REPORT — TK-12228 · every captured photo (FRONT + BACK) displays everywhere
Target: local `~/Projects/dw-photo-capture` starting at **d1a0b78**, test server `PORT=9987 DWP_TEST_DIR=/tmp/dwp-e2e
node server.js --test` (log confirmed `Shopify push: STUBBED (--test)` on every start; no Shopify / dw_unified /
FileMaker writes). Pages: `/`, `/captures`, `/batch`, `/cam`. Not deployed by this loop. Test server killed at the end.
Cody gate: run separately by the parent (not in this loop).
## Sweep ledger
| sweep | passed / total (targeted) | caught (app / harness+env) | fixed | commit |
|---|---|---|---|---|
| 1 | e2e C 19/19 · W 18/19 · F 18/19; 3x M3 FAIL ×3, M2 FAIL /cam | 2 app (favicon 404 ×3 pages; missing-side rule mismatch) / 4 harness | 2 app + harness | `15beb44` |
| 2 | 7/8 targeted + WebKit cold CRASH 4/4 pre-fix | 1 app (camera-timeout retry never reaches snap camera) / 2 harness | 1 app + harness | `4fd7dee` |
| 3 | 7/11 — **invalid** (server killed mid-sweep) | 0 app / 1 harness (WebKit hung-cam stub), 1 env | harness | `bf95f56` |
| 4 | 5/7 then ABORT — **invalid** (server killed) | 0 app / 1 harness (Firefox 32767px full-page screenshot), 1 env | harness | `0e8aa0e` |
| 5 (cap) | **11/11 targeted + 3x M1/M3/B4 all pages** (split across one server restart) | 0 app / 1 env | — | (report commit) |
**Stop reason: 5-sweep cap.** Sweep 5 is clean, but it is the ONLY clean sweep (3 and 4 were invalidated by the
test server being SIGTERM'd from outside), so the "2 consecutive clean" condition was **not met**. No-progress guard
never tripped: no defect recurred after its fix.
## App defects found + fixed
1. `/captures`, `/batch`, `/cam` had no `<link rel=icon>` → `/favicon.ico` 404 console error on every load
(captures NEW; batch + cam pre-existing at 126f917). Fixed in 15beb44.
2. "Missing a side" rule inconsistent (NEW code): `/api/captures missing_back` counted single-shot remote-cam /
`photo`-only items (5 vs the real 1), and the "Missing a side first" sort ranked them first while their cards
weren't flagged. One rule now: a front/back item lacking a side. Negative proof: old rule = 5, new = 1. 15beb44.
3. **Camera-timeout recovery dead-ended (pre-existing since TK-12124 / 9f4d2c2, present at 126f917).** After the
live camera timed out, the toast said "tap Photo 1 again to use the snap camera", but the tap re-ran live
getUserMedia → another 8s hang, forever; a phone with a hung camera could never capture front/back. Now the
next Photo 1/2 tap opens the native `<input capture>` inside the fresh user activation. Negative proof: with
15beb44's index.html the WebKit hung-camera journey goes RED (no file chooser); with the fix 21–22/22 in all
3 engines. 4fd7dee. ⚠ Behaviour change on the live capture page — worth Cody's eye.
## Final six-way state per browser (sweep 5)
| | Chromium | WebKit (Safari engine) | Firefox |
|---|---|---|---|
| front/back journey, LIVE camera (tiles → preview → created → lightbox → disk → /api/photos → batch-shot → legacy → /captures history + sort/density persist + lightbox → batch thumbs → cam remote shot) | 19/19 | 19/19 (warm) · 21/21 (cold: snap→live) | 19/19 |
| same journey, camera hung → timeout → SNAP file input (shotAdd) | 22/22 | 22/22 | 22/22 |
| 4 pages: 0 console errors / pageerrors / 4xx / broken imgs | PASS | PASS | PASS |
| index launcher + 7 toolbar buttons | PASS | PASS | PASS |
| /captures lazy thumbs all load (naturalWidth>0) | PASS | PASS | PASS |
| missing-side rule UI | PASS | PASS | PASS |
| /3x runner M1 HTTP / M3 automation / B4 | PASS all 4 pages (system Chrome) | B5 SKIP (runner's pw 1.57 has no WebKit build; install attempt hung) | B6 SKIP (same) |
| /3x M2 headless CLI screenshot | PASS `/` `/captures` `/batch`; FAIL `/cam` = SSE keeps Chrome's virtual-time budget from elapsing (harness) | — | — |
WebKit coverage caveat: Playwright WebKit on macOS is the Safari *engine*, not iOS Safari on a phone —
real-device camera behaviour (iOS permission prompt, `capture` input opening the iOS camera app) was NOT exercised.
## Open issues (not fixed)
- **ENV: the unmanaged test server gets SIGTERM'd from outside ~7–10 min after start** (5 times; logged via a
`-r` preload: `got SIGTERM`, ppid=1, own session). Sender unidentified (keep-alive, pm2-fracture-canary,
orphan-session-reaper checked — none match). This is what invalidated sweeps 3–4 and blocked clean-twice.
Run longer sweeps under pm2 (not the prod app name) or find the reaper.
- /3x generic clickthrough on `/` times out on 7 toolbar buttons because `#homeScreen` is a by-design modal
launcher overlay (covered by 5x/tools/index-toolbar-click.cjs). /cam M2 = SSE harness limit. B5/B6 = runner tooling.
- WebKit mock-camera flake: 1 of 5 warm runs, cam.html's phone camera never came up in 45s (now a loud FAIL with
screenshot, not a silent pass). Not reproduced after.
- Pre-existing (not fixed, out of scope): `pairStatus().cam_connected` goes false 20s after the phone opens /cam
if its camera hasn't started (lastSeen only refreshed by camera-status posts, not the live SSE).
- Observation: /captures renders up to 2000 cards on one page (no pagination) — long histories get very tall.
## Commits after 15beb44 (the one already deployed) — for the follow-up deploy
- `4fd7dee` 5x sweep 2 — **app change**: public/index.html camera-timeout → snap fix (+ e2e/tools)
- `bf95f56` 5x sweep 3 — harness only (e2e HUNG_CAMERA mode, sweep.sh)
- `0e8aa0e` 5x sweep 4 — harness only (e2e screenshot)
- report commit — 5x/REPORT.md + sweep-5.md only
(`b49fdf9` is the coordinator's .deploy.conf commit.) Only `4fd7dee` changes served code.
## Artifacts
- Sweep notes: 5x/sweep-1.md … sweep-5.md · driver 5x/tools/sweep.sh · tools 5x/tools/*.cjs
- Logs: 5x/out/sweep-{1..5}/ (gitignored) · screenshots: 5x/out/screens/shots-sweep5-{chromium,webkit,firefox,webkit-hung,firefox-hung}/
- Re-run: start the --test server, then `bash 5x/tools/sweep.sh <n>`
- Previous (TK-11947) report archived at 5x/archive/REPORT-TK-11947.md