Skip to content

fix(register): show email warnings while typing (@fehmer) - #8662

Closed
fehmer wants to merge 2 commits into
masterfrom
fix/register-email-warning
Closed

fehmer wants to merge 2 commits into
masterfrom
fix/register-email-warning

Conversation

@fehmer

@fehmer fehmer commented Dec 4, 2026

Copy link
Copy Markdown
Member

Summary

The register form's email warnings (education / typo / disposable) stopped showing after #7816 (1cefe7cf4) rewired the verify-email cross-check from a manual validateField call to onChangeListenTo: ["email"].

form-core runs linked fields' sync validators inside the field's own validateSync; the verify field's verify email not matching email error (verify still empty while typing) sets hasErrored on the email field, and FieldApi.validate then aborts the email's async validation (hasErrored && !asyncAlways). emailIsValid never runs, hasWarning is never set, and the indicator shows the success check.

 // Register.tsx — email field
 <form.Field
   name="email"
+  asyncAlways
   validators={{
     onChange: fromSchema(UserEmailSchema),
     onChangeAsync: (field) =>
       handleResult(field.fieldApi, await emailIsValid(field.value)),
   }}

asyncAlways is form-core's option for exactly this: keep async validation running while the sync pass has errored.

Other forms checked: onChangeListenTo only exists in this form (emailVerify, passwordVerify). Email is the only field that combines async validation with a linked field that can error (passwordVerify's linked password field has no async validator; the remote-availability usernames in Register / ThirdPartySignUpModal / ProfileSearchPage have no linked fields). Unrelated to the @tanstack/solid-form version — the bug exists on 1.29.1 (the version at the time of #7816) through 1.33.6.

Evidence

  • Before: typing test@example.edu leaves the indicator on fa-check; field store never shows isValidating: true or hasWarning (async validator aborted). New regression test fails: expected "vi.fn()" to be called at least once (handleResult, the async warning handler, is never invoked).
    After: test passes — handleResult called with the education warning and hasWarning: true on the field.
  • Browser check (localhost:3000/login, register form):
    • empty → no icon
    • plain@example.com → fa-check
    • test@example.edu → fa-exclamation-triangle + tooltip Some education emails will fail to receive our messages, or disable the account as soon as you graduate…
  • pnpm vitest run: 135 files, 2027 tests, all pass. oxlint (core + type-aware) clean.

Merge Danger

Door: two-way

Blast Radius: register form's email field only. Async email validation (pure regex/module checks, no network) now also runs on keystrokes with a sync error, e.g. while the email is invalid — worst case it sets a warning that the error indicator takes precedence over.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant