Retrospring / retrospring

Q/A based social network
https://retrospring.net
GNU Affero General Public License v3.0
260 stars 35 forks source link

Muting and blocking a user leads to an error #1393

Closed pixeldesu closed 1 year ago

pixeldesu commented 1 year ago

Steps to reproduce the problem

  1. Mute a user
  2. Try to block the same user
  3. Toast saying "An error occured, please check the console"

Expected behaviour

I should be able to block a user I have muted.

Actual behaviour

An error occurs and the user is not blocked.

Detailed description

(From development context)

This is the error in the backend:

ActiveRecord::RecordNotUnique at /ajax/create_relationship
==========================================================

PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_relationships_on_source_id_and_target_id"
DETAIL:  Key (source_id, target_id)=(109843553042504847, 109843587838291678) already exists.

Specifications

Retrospring 2023.1017.1

canny[bot] commented 1 year ago

This issue has been linked to a Canny post: Mute & Blocking mutually exclusive :tada: