Moving the default notification state for a tag gives error

  • Go to the “tags default notifications” for a group
  • Add a tag to “watching”
  • Save

  • Remove the tag from “watching”
  • Add the same tag to “tracking”
  • Save

ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "idx_group_tag_notification_defaults_unique" DETAIL: Key (group_id, tag_id)=(45, 36) already exists.

Looks like the code does not first remove the records that need to be removed and then adds the records that need to be added, but tries to do it all at once.

Pressing “Save” in between removing it and adding it works around the issue.

The interface in user preferences does not allow this by the way, you are unable to select it for another category if you just removed it - you are forced to press Save first.

4개의 좋아요

Hi @RGJ, thanks for the report!
This should be fixed after:
https://github.com/discourse/discourse/commit/0c019b2e45787b9062605904e4a9dff07b4f2331

3개의 좋아요

This topic was automatically closed after 4 days. New replies are no longer allowed.