Double entry in default watch list @ user preferences -> registration impossible

I run into the following issue:

By accident, I entered two times the same category into the default user preference field for the default watched categories.

Result: Accounts could not be created anymore

PG::UniqueViolation (ERROR: duplicate key value violates unique constraint "idx_category_users_u1" DETAIL: Key (user_id, category_id, notification_level)=(16, 11, 3) already exists. )

Solution: I removed the enry from the watch list so that the list was unique.

However, I would expect that Discourse doesn’t allow to add two times the same category to the watch list.

Best,
Robert

What version are you on? We fixed this about a week or two ago via a unique table index.

Yeah we should definitely guard against this buggy site setting a bit better.

The bug is that if you add “default watch” == “bug bug” we allow you to save it.

3 Likes

I’m on version v1.5.0.beta7 +48

Ok @techapj can you add this to your list? A client-side check for duplicates.

1 Like

I am not able to repro this issue. :confused:

Once I select a category from category list, I am not able to select the same category again (as expected).

Can you repro this here @rriemann? or on try.discourse.org?

I had category names like “A Announcements” and “B Announcements”. With the
Discourse version I stated above, I cannot reproduce this either. It must have
been a left over from a previous version, I guess. Now, the error message can
be googled with a solution, it should be fine. :slight_smile: