2.6 KiB
2.6 KiB
2026-03-28 Q-004 Coverage Remediation Pass 12
Scope
- Continue strict
Q-004closure work after Pass 11. - Fully close the remaining low-coverage
frontend/admin/src/lib/http/client.tsmodule before moving to the next task. - Re-verify closure through targeted tests plus full frontend validation.
Changes
Frontend
- Extended module coverage in:
frontend/admin/src/lib/http/client.test.ts
- Newly covered behavior includes:
- business-error refresh rejection and session cleanup
- request retry during an already in-flight refresh
- failed shared-refresh retry when no access token remains
- caller-provided
AbortSignalpropagation - download retry path that still ends in
401
- Hardened refresh hygiene in:
frontend/admin/src/lib/http/client.ts
- Production code change:
- the cached shared refresh promise is now stored as a non-rejecting waiter promise
- this keeps concurrent waiters working while avoiding an unhandled rejected promise when refresh fails
Backend
- No backend code changes were required in this pass.
Verified Commands
cd D:\project\frontend\admin
npm.cmd run test:run -- src/lib/http/client.test.ts
npm.cmd run lint
npm.cmd run build
npm.cmd run test:coverage
Results
Frontend coverage
- Overall:
- statements
83.86% - branches
72.68% - functions
79.87% - lines
84.72%
- statements
- Target areas:
src/lib/http/client.ts: statements100%, branches92.30%, functions100%, lines100%src/lib/http/csrf.ts: statements100%, branches88.46%, functions100%, lines100%src/pages/admin/ProfileSecurityPage/ProfileSecurityPage.tsx: statements70.17%, branches48.97%, functions67.92%, lines70.40%
Validation Notes
- Frontend full coverage now completes with
42passing test files and193passing tests. - The required sequential frontend validation path passed:
test:run -- src/lib/http/client.test.tslintbuildtest:coverage
- The successful frontend coverage run still emits one post-summary jsdom
AggregateErrornetwork-noise line.- It does not fail the command.
- It remains a real validation-hygiene issue and should continue to be tracked honestly.
Real Conclusion
src/lib/http/client.tsis no longer an openQ-004gap.- The
lib/httphotspot is now closure-grade for the targeted modules covered in this pass. Q-004still cannot be honestly declared closed.- The remaining highest-value frontend gap is now more concentrated in:
- deeper remaining
ProfileSecurityPagebranches - the post-summary jsdom
AggregateErrorcoverage-noise hygiene issue
- deeper remaining