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¶
- Prepare email that has no account linked, test username, and password
- Go to create account and enter the email, test username, and password
- Open email and get verification code
- 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¶
- Screenshots: DEF-001-1 DEF-001-2
- Console logs: DEF-001-console-1 DEF-001-console-2
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¶
- Commit:
6c12626
- PR: fix: DEF-001
Verification (post-fix)¶
Build/Env: a0dad94
/ 2025-12-09
— <env: prod>
Tester: Michael DeReus
Result: Pass
Steps executed¶
- Followed the original repro steps:
- Register with email/password.
- Enter verification code and press Verify.
- Observed post-fix behavior:
- User auto-signed in (Cognito session created).
- Redirected to /rank without error.
- Navbar/avatar render with expected profile picture.
- Session checks:
- Reloaded /rank → remained authenticated (no redirect loop).
- Signed out → routed to /login; signed back in successfully.
Evidence¶
- Screenshot/GIF: DEF-001-verify.png DEF-001-verify-rank.png
- Console log: DEF-001-verify-console
Notes: Also re-ran related smokes (Login/Logout/Protected routes) — all passed.