appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
33.95k stars 3.66k forks source link

[Bug]: Input field in Email mode validates incorrectly for long TLD #33837

Open dlopez-tcde opened 4 months ago

dlopez-tcde commented 4 months ago

Is there an existing issue for this?

Description

Input field in Email mode validates incorrectly for long domain TLD.

Workaround: Change input type to single line text and set the regex using an RFC 5322 compliant expression:

(?:[a-z0-9!#$%&'+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&'+/=?^_`{|}~-]+)|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\[\x01-\x09\x0b\x0c\x0e-\x7f])")@(?:(?:a-z0-9?.)+a-z0-9?|[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)])

Steps To Reproduce

Public Sample App

No response

Environment

Production

Severity

Low (Cosmetic UI issues)

Issue video log

No response

Version

Self Hosted v1.22.1

razelos commented 3 months ago

Hey, after looking this issue I realized that Valid doesn't work in this way. It is not used to store valid emails but it takes boolean expressions (true or false) that are used to validate emails. Issue should be marked as closed. image

dlopez-tcde commented 3 months ago

Let me clarify - try creating a new form and adding the input control. Change the data type to "Email", and set the "required" field of the input to "true". Try and fill out the form using "testing@test.school". The input immediately validates to "Invalid input", and you can't submit the form. Expected validation behavior should resolve to valid, as the .school domain is a valid Top Level Domain. I think what is happening is whatever default validation logic that is baked into the input widget only allows TLDs up to 4 characters.

razelos commented 3 months ago

Okay, I will check it out then.

On Thu, 6 Jun 2024, 18:30 dlopez-tcde, @.***> wrote:

Let me clarify - try creating a new form and adding the input control. Change the data type to "Email", and set the "required" field of the input to "true". Try and fill out the form using @.***". The input immediately validates to "Invalid input", and you can't submit the form. Expected validation behavior should resolve to valid, as the .school domain is a valid Top Level Domain. I think what is happening is whatever default validation logic that is baked into the input widget only allows TLDs up to 4 characters.

— Reply to this email directly, view it on GitHub https://github.com/appsmithorg/appsmith/issues/33837#issuecomment-2152822780, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3V4BZ3SMA2HDGEXNVS6NB3ZGB6CXAVCNFSM6AAAAABIPKXFNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJSHAZDENZYGA . You are receiving this because you commented.Message ID: @.***>