sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.12k stars 1.29k forks source link

fix/enterpriseportal: fix invalid argument errors #64498

Closed bobheadxi closed 3 months ago

bobheadxi commented 3 months ago

At some point, I introduced a fast-path for subscription upsert where if no conditions are provided, we fail to check for constraint errors and wrap them with ErrInvalidArgument.

This change makes it so that we correctly check for constraint errors in both paths.

Fixes https://sourcegraph.sentry.io/issues/5717030715/?referrer=slack&alert_rule_id=15230143&alert_type=issue

Test plan

DB tests