fix: restore verifyEmail error logging#2340
Draft
leno23 wants to merge 1 commit into
Draft
Conversation
|
aalemayhu
reviewed
May 17, 2026
Contributor
aalemayhu
left a comment
There was a problem hiding this comment.
Welcome, and thanks for the focused fix — small PR, clear repro test, matches the parallel 'Magic link verification failed:' pattern at line 761. Nothing here blocks merge.
Verdict: approve (comment-only since I can't self-approve via tooling)
A missing log was making #2295 harder to debug; restoring it is a direct simplicity win.
Blocking
- None.
Nits (optional, not asks)
src/controllers/UsersControllers.test.ts— the test asserts both calls happened but not the order. Since the regression is "log before forward", you can lock it in withexpect(consoleError.mock.invocationCallOrder[0]).toBeLessThan(next.mock.invocationCallOrder[0]). The source has them on consecutive lines so it's implicit today, but the assertion would catch a future reorder.src/controllers/UsersControllers.test.ts— thetry/finally + mockRestoreis correct but slightly heavier than needed;verifyEmailcatches its own errors, so a trailingconsoleError.mockRestore()would do. Matter of taste.
When you're ready, flip from draft with gh pr ready 2340 and I'll merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
verifyEmailcatch-block error log before forwarding to Express error handlingnext(error)Closes #2295
Tests
src/controllers/UsersControllers.tsandsrc/controllers/UsersControllers.test.tsparse successfully with the TypeScript parserconsole.error('Email verification failed:', error)and the regression test asserts that log +next(error)pathNot run:
pnpm test src/controllers/UsersControllers.test.tsbecause bothgit cloneand GitHub archive download for a full checkout were denied in this environment. The patch is intentionally small and includes the focused Jest regression test for project CI to run.Need help on this PR? Tag
@codesmithwith what you need.