Skip to content

feat(frontend): idempotency keys, request validation, Lighthouse budget, Statistics (#1340 #1341 #1349 #1351) - #1463

Merged
hman38705 merged 6 commits into
solutions-plug:mainfrom
chideraisiguzor:feat/1340-1341-1349-1351
Sep 1, 2026
Merged

feat(frontend): idempotency keys, request validation, Lighthouse budget, Statistics (#1340 #1341 #1349 #1351)#1463
hman38705 merged 6 commits into
solutions-plug:mainfrom
chideraisiguzor:feat/1340-1341-1349-1351

Conversation

@chideraisiguzor

Copy link
Copy Markdown
Contributor

Description

Four issues from the PredictIQ frontend rebuild backlog, all in the frontend package.

Full per-issue write-up: frontend/docs/pr/chideraisiguzor-1340-1341-1349-1351.md.

Type of Change

  • Bug fix
  • New feature
  • Refactor / code cleanup
  • Documentation update
  • CI / tooling change
  • Breaking change

Testing Done

From frontend/:

./node_modules/.bin/jest src/components/__tests__/Statistics.test.tsx \
  src/lib/api/__tests__/idempotency.test.ts \
  src/lib/api/__tests__/request-validation.test.ts \
  src/lib/api/__tests__/client.test.ts \
  scripts/__tests__/lighthouse-audit.test.js
# Test Suites: 5 passed, Tests: 106 passed

New suites: idempotency.test.ts (key reused across a 429-then-200 retry, stateful deduping-backend mock), request-validation.test.ts (malformed body rejected locally with fetch never called), lighthouse-audit.test.js (LCP/CLS over budget fails, missing metric fails), and the rewritten Statistics.test.tsx (real mocked /api/v1/statistics payload + an all-zero response asserting every tile renders 0/$0).

Pre-existing breakage, not touched: main is mid-migration to the new useAsync contract - tsc --noEmit reports ~351 errors, mostly other consumers still on the old { loading, execute } API. Only the two files named in #1351 are fixed here (count drops 360 -> 351, no new errors in touched files). LandingPage.accessibility.test.tsx also has 6 unrelated failing assertions. Left for their own issues per the contribution guidance.

Bundle Size

No dependency added (Zod is already a direct dependency). lighthouse / chrome-launcher are now lazy requires, so they no longer load unless the audit script actually runs. Runtime component/client changes are small; not separately measured.

Chunk Before After
vendor.js
main*.js
pages/_app*.js

Checklist

  • Tests pass locally
  • Documentation updated (if applicable)
  • No breaking changes, or breaking changes are documented above
  • If you added or changed an API endpoint, regenerated the OpenAPI spec - N/A, no API change
  • If you changed system architecture - N/A
  • Bundle size checked (if frontend changes) - see note above

Related Issues

Closes #1340
Closes #1341
Closes #1349
Closes #1351

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@chideraisiguzor Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

- Merge origin/main. Take main's Statistics component/tests/page (a superset
  of this branch's solutions-plug#1351 after solutions-plug#1353/solutions-plug#1354 landed on main); keep both
  api-client import groups in public-client.ts; drop the stale tsconfig.tsbuildinfo.
- frontend: move typescript from ^7.0.2 to ^5.9.3. openapi-typescript@7 and
  typescript-eslint@8 peer-require TS 5.x, and TS 7 rejects tsconfig 'baseUrl',
  so 'npm ci' / 'generate-client' fail on TS 7.
- frontend: regenerate package-lock.json, which was out of sync with
  package.json (npm ci failed on every frontend CI job).
- frontend: regenerate schema.d.ts from the current services/api/openapi.yaml.
- admin-client.ts: import reportResponseHeaders (referenced but not imported).
@hman38705
hman38705 merged commit eba352d into solutions-plug:main Sep 1, 2026
12 of 59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants