• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / gotrue / 5287582134
65%

Build:
DEFAULT BRANCH: master
Ran 16 Jun 2023 08:03AM UTC
Jobs 1
Files 105
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Jun 2023 08:03AM UTC coverage: 66.314%. Remained the same
5287582134

push

github

web-flow
fix: duplicate identity error on update user (#1141)

## What kind of change does this PR introduce?
* When updating a user's email or phone number, if the user previously
did not have an email or phone number associated to their account,
gotrue will create an new identity for it. However, subsequent attempts
to update the user's email or phone number will result in gotrue
attempting to create the same identity again. This results in postgres
returning a unique constraint violation.

For example, assuming that the user signed up with email + password
initially:

```bash
# this request will create a phone identity and send an OTP to the user
curl -X PUT "http://localhost:9999/user" -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{"phone": "123456789"}'

# this request will return a "duplicate key value violates unique constraint" error because gotrue attempts to create the same phone identity
curl -X PUT "http://localhost:9999/user" -H "Authorization: Bearer <access_token>" -H "Content-Type: application/json" -d '{"phone": "123456789"}'
```

* ~This PR attempts to fix this issue by only creating the identity if
the user's `phone` or `phone_change` columns are empty.~

7026 of 10595 relevant lines covered (66.31%)

47.43 hits per line

Jobs
ID Job ID Ran Files Coverage
1 5287582134.1 16 Jun 2023 08:03AM UTC 0
66.31
GitHub Action Run
Source Files on build 5287582134
Detailed source file information is not available for this build.
  • Back to Repo
  • 39ca89c6 on github
  • Prev Build on master (#5256363835)
  • Next Build on master (#5287687402)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc