Skip to content

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

Open
chideraisiguzor wants to merge 5 commits into
solutions-plug:mainfrom
chideraisiguzor:feat/1340-1341-1349-1351
Open

feat(frontend): idempotency keys, request validation, Lighthouse budget, Statistics (#1340 #1341 #1349 #1351)#1463
chideraisiguzor wants to merge 5 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant