OpenFn / OpenFn/lightning

Use specific error message for unique email constraint violation

Open
#2,824 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Elixir
Stars
296
Forks
86
Avg merge
1d 13h
Merged PRs (30d)
50

Description

Describe the bug

Currently all email conflicts and unique constraint violations generate an email error message:
"This email address already exists."

The message was generalized on workflows API work to report other field errors correctly, but email message needs to be a specific.

Version number

v2.10.9

I have reproduced this locally on main:

  • Yes
  • No

To Reproduce

  1. Go to any screen with a field that is not an email and needs to be unique and uses the ChangesetJSON
  2. Try to duplicate it and it shall show "This email address already exists."

Expected behavior

Use "This email address already exists." for email

Use "This value should be unique." for other fields (fixed on Workflows API)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how ChangesetJSON formats unique-constraint errors, then compare the related Workflows API change in PR #2792. The fix is complete when email uniqueness still uses the email-specific message and other unique fields use the generic uniqueness message.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.