Skip to content

← Back to baseline

DEF-001 — Verification code error

Summary

User clicks "verify" when inputting valid verification code and gets an error on screen.

Environment

  • App: melodex.io
  • Commit (SHA): a0dad94
  • Browser: Firefox 142.0.1 (Desktop)
  • Device: Windows 11 Desktop
  • Network: Spectrum (approx 450 up / 11 down)
  • Date: 09-09-2025

Preconditions

  • One account can authenticate (Email and/or Google) and reach /rank.
  • Email and password ready for registration process.

Steps to Reproduce

  1. Prepare email that has no account linked, test username, and password
  2. Go to create account and enter the email, test username, and password
  3. Open email and get verification code
  4. Enter verification code and click "Verify"

Expected Result

After clicking "verify", the account is activated, the user is authenticated, page the redirects to /rank.

Actual Result

Verification code is accepted, but a TypeError (_ is not a function) appears under “Back to Login” and no automatic redirect occurs.

Impact

Confuses the user and interrupts onboarding; user may think the verification failed. Requires manual navigation to continue, reducing trust in the flow.

Triage

  • Severity: Major
  • Priority: Medium

Attachments

Suspected Areas

  • Register.jsx → handleVerify() after Auth.signIn, and any code called by checkUser()

Diagnostics (what we tried)

  • Registering with other account details
  • Clicking register again, which leads to DEF-001-2 and DEF-001-console-2
  • Refreshing the page, which succesfully loads authenticated /rank state

Owner: Michael DeReus
Status: Resolved 2025-12-09
Opened: 2025-09-09

Linked Items

  • Risk: R-01 (Onboarding/auth failures)
  • Test: SMK-00 (in baseline)

Root Cause (fill after fix)

The UserContext provider did not expose setter functions (setUserID, setDisplayName, setProfilePicture). During the post-verification path in Register.jsx → handleVerify(), the component called these setters, causing TypeError: setUserID is not a function. This blocked the redirect to /rank despite a successful confirmSignUp + signIn.

Fix Reference

Verification (post-fix)

Build/Env: a0dad94 / 2025-12-09<env: prod>
Tester: Michael DeReus
Result: Pass

Steps executed

  1. Followed the original repro steps:
  2. Register with email/password.
  3. Enter verification code and press Verify.
  4. Observed post-fix behavior:
  5. User auto-signed in (Cognito session created).
  6. Redirected to /rank without error.
  7. Navbar/avatar render with expected profile picture.
  8. Session checks:
  9. Reloaded /rank → remained authenticated (no redirect loop).
  10. Signed out → routed to /login; signed back in successfully.

Evidence

Notes: Also re-ran related smokes (Login/Logout/Protected routes) — all passed.