Skip to content

Improve participant flow QA safeguards#29

Open
Spbd1 wants to merge 1 commit into
codex/add-protected-diagnostics-endpointfrom
codex/perform-final-qa-pass-on-participant-flow
Open

Improve participant flow QA safeguards#29
Spbd1 wants to merge 1 commit into
codex/add-protected-diagnostics-endpointfrom
codex/perform-final-qa-pass-on-participant-flow

Conversation

@Spbd1

@Spbd1 Spbd1 commented May 11, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Prevent crashes and 404s during final participant flow caused by stale or partial localStorage and a missing submission route.
  • Ensure silent revision-lock/unlock logic and replay behavior remain robust when fields are missing or optional.
  • Reduce React hook linter noise from the background autosave and make autosave logic more robust.

Description

  • Added a final submission route app/export/submission/page.tsx that renders the existing ExportPanel so /export/submission does not 404.
  • Hardened stored-session normalization in utils/session.ts to defensively validate and normalize optional fields (participant profile, pre/post surveys, game/replay objects, revision metadata) so old/stale localStorage shapes yield safe defaults.
  • Added helper normalizers and readers (normalizeParticipantProfile, normalizePreRevealSurvey, normalizePostRevealSurvey, and utility readers) to avoid unsafe property access and provide safe defaults for forms and completeness checks.
  • Updated components/ParticipantBackgroundForm.tsx autosave effect to use a functional state update to eliminate a stale hook dependency and reliably persist participantProfile.
  • Added docs/MANUAL_QA_CHECKLIST.md with step-by-step browser checks for the full participant flow, back-navigation revision behavior, replay, stale localStorage, server submission, and admin exports.

Testing

  • Ran npm run typecheck and it completed successfully. ✅
  • Ran npm run lint and fixed the earlier hook warning; final lint passed with no errors. ✅
  • Ran npm run build and Next.js compiled and statically generated pages successfully. ✅
  • Validated the example export with npm run validate:sample (Zod schema) and it succeeded. ✅

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant