# Independent bug fix: slow / empty client screen For a user-reported bug on an actively used screen ("page is slow", "cards are empty") handled as a standalone job outside the current sprint. ## Setup - Worktree from `main` (not the sprint branch): `git worktree add .worktrees/bug- -b fix/ main`. - Dispatch via `hermes -p chat ... --oneshot` like a feature (no delegate_task when the user said so). - Merge into main and then into the sprint branch only after user approval; no push. ## Brief must-haves (in this order for the worker) 1. Find the endpoint(s) the screen calls and count requests per load (per-profile fan-out is a common cause). 2. Explain WHY a card is empty before touching code: data missing vs. UI gated on the slowest request vs. chart lib vs. error swallowed. 3. Reproduce on the emulator with LARGE synthetic data in an isolated Hermes copy (never the real session database / dashboard port); pin the emulator with `adb -s`, never send commands to a physical device. 4. Add a unit test that captures the root cause and is RED on the pre-fix code (save the red XML/output), GREEN after. Virtual-time tests (kotlinx-coroutines-test) work well for latency/concurrency bugs. 5. Fix the root cause; measure before/after (3 runs each, median) per filter; log perf lines to logcat (e.g. `insights perf card=top|profiles|all-done requests=N`) so the user can re-measure on a phone. 6. Regression list: every filter/segment, single vs all mode, empty/no-cost, DB-unavailable (503), HTTP 500, offline, light + dark theme, small fake_gateway data. 7. Steps for a real-device check (left open, user-approved), and server-side suggestions written down but not implemented if the server is another team's scope. ## Evidence layout `docs/qa/bugs//`: `RAPOR.md` (summary/root cause first, AC table K1..K5, regression table, isolation, known limits), `olcum/onceSonra-medyan.md`, `olcum/*RED*.xml`, `logcat/*.txt`, `izole-kontrol.txt`, `shots/NN-----.png` (the filename states the claim, so vision check = does the image match its name). ## Typical root-cause pattern (client fan-out dashboards) - One `awaitAll` over N profiles gates the top cards on the slowest profile -> blank boxes for seconds while lighter cards fill first. - Unbounded concurrency (dozens of requests at once) slows the server for everyone. - No read timeout on analytics calls -> screen can wait forever. - Fix shape: bounded concurrency (measure the plateau, e.g. 6), progressive aggregation with an explicit "Loading n/N · total may grow" line, labelled loading boxes instead of empty ones, per-call timeout surfaced as a row error. Expect "first data" to improve a lot and "all done" only slightly — the rest is server work; say so in the report and route a batch endpoint suggestion to the server owner. ## User report shape Turkish, plain text: status line; numbered endpoint / why empty / repro / root cause+fix / before-after table (first data, top cards full, all full per filter) / regression / tests (own `--rerun` count) / isolation; then open items; then **Sorular** (merge locally? who does the real-device check? forward out-of-scope server suggestions?).