Skip to content

[BUG]: genui's email check rejects every real address #2854

Closed
flutter/genui
#1026

Description

@diegolopezrm
  • I have searched the existing issues to make sure this bug has not already been reported.

Describe the Bug

genui's email check rejects every real email address. EmailFunction.executeSync (basic_functions.dart:312) builds its pattern as:

final emailRegex = RegExp(r'^[^@]+@[^@]+\.[^@]+\$');

It is a raw string, so \$ is a backslash followed by a dollar sign rather than the end-of-string anchor. The pattern asks for an address that literally ends in \$.

value today with the anchor
[email protected] false true
[email protected] false true
[email protected]\$ true true
nope false false

So the only values that pass are the ones nobody would type.

This is invisible right now because of #2853: checks never fail either way. Once that is fixed this one starts rejecting valid input, which is why it seemed worth filing separately.

Steps to Reproduce

final context = DataContext(
  model..update(DataPath('/e'), '[email protected]'),
  DataPath.root,
  functions: BasicCatalogItems.asCatalog().functions,
);

// false
print(await context.evaluateConditionStream({
  'call': 'email',
  'args': {'value': {'path': '/e'}},
}).first);

Expected Behavior

email('[email protected]') is true.

Additional Context

The fix is dropping the backslash, RegExp(r'^[^@]+@[^@]+\.[^@]+$'), which is what the table above measures. Happy to send it along with the #2853 work if you want them together.

Activity

  1. added
    status: needs-triageauto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs
    on Sep 28, 2026
  2. nan-yu commented on Sep 28, 2026

    @nan-yu
    Collaborator

    A2UI Triage: Thanks for reporting. We will investigate the email validation regex logic in genui. cc @polina-c

  3. removed
    status: needs-triageauto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs
    on Sep 28, 2026
  4. polina-c commented on Sep 29, 2026

    @polina-c
    Collaborator

    Seems to be P1. I will take it.

  5. self-assigned this
    on Sep 29, 2026
  6. added
    P1This is a priority. Team is actively working on it, or will be soon.
    and removed
    P2The team intends to work on this in the near future, or at a lower priority.
    on Sep 29, 2026
  7. added a commit that references this issue on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions