fix(grid): validate email format in the import preview (objectstack#3566) - #2840
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…566) ImportWizard's per-cell validateValue did no format check for email columns, so a bad address like `x@柴仟.com` passed client + dry-run validation and only failed at real-import time inside better-auth. - Added isPlausibleEmail (single-pass, ASCII, ReDoS-safe) mirroring the server's isLikelyEmail; email cells are now flagged red in the preview before submit. - Unit test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Companion UI change for objectstack-ai/objectstack#3566. Server PR: objectstack-ai/objectstack#3572.
Problem
The ImportWizard's per-cell
validateValuedid no format check foremailcolumns (it fell through todefault → true), so an obviously-bad address — e.g. a non-ASCII domain likex@柴仟.com— passed client validation and the server dry-run, and only failed at real-import time inside better-auth. A jarring "passed validation, then failed" experience.Change
isPlausibleEmail— a single-pass structural + ASCII check that mirrors the server'sisLikelyEmail— and wired it intovalidateValue's newemailcase. Bad email cells are now flagged red in the preview step, before submit. No regex backtracking (same ReDoS-safety as the server).Tests
packages/plugin-grid/src/importEmailValidation.test.ts— accepts normal, rejects non-ASCII (the reported bug) + structurally-broken, fast on adversarial input.🤖 Generated with Claude Code