getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
36.96k stars 3.97k forks source link

Notifications: Duplicate Notification Setting Provider Rows #69267

Open davidenwang opened 1 week ago

davidenwang commented 1 week ago

For ~30+ users we have some duplicate rows in the sentry_notificationsettingprovider table: https://redash.getsentry.net/queries/6535/source

This is leading to get() returned more than one NotificationSettingProvider when we try to do updates on notification settings here https://github.com/getsentry/sentry/blob/714fabf11fc03a591f9ddc98dd5ec6561502ea3e/src/sentry/api/endpoints/user_notification_settings_providers.py#L77

This is preventing certain users from editing their notification settings and a user has already written in about this bug they are experiencing.

We will most likely need a backfill here to fix the duplicate rows, but should also try to understand how these rows got into the database despite the unique constraint that is placed on the model.

davidenwang commented 6 days ago

This may be resolved now, the query in redash show no more duplicate rows.