Skip to content

Bug: Share Alarm: Email validation regex rejects valid domains with hyphens or subdomains. #924

@vibhutomer

Description

@vibhutomer

Description

When a user attempts to share an alarm via the ShareDialog, the email input field strictly validates the email using a regex that does not support hyphens or subdomains in the domain name.

If a user enters an email like hello@my-domain.com or student@cs.university.edu, the regex fails and throws an "Invalid email" Snackbar, completely blocking the user from sharing the alarm.

Steps to Reproduce

  1. Open the app and create an alarm.
  2. Tap the Share icon to open the ShareDialog.
  3. Tap the + icon to add a new user.
  4. Enter a valid email with a hyphenated domain (e.g., test@open-source.org).
  5. Tap the Add icon.
  6. Observe the "Invalid email" error Snackbar.

Expected Behavior

The app should accept standard valid email addresses, including those with hyphens in the domain name and multiple subdomains, allowing the user to be added to the IsarDB Saved_Emails table.

Proposed Solution

Update the regular expression in share_dialog.dart to a standard robust email regex that accounts for - and . within the domain grouping.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions