当标签同义词在主题上已存在时添加错误

看起来当前的代码无法处理在创建同义词时,主题已经同时包含这两个标签的情况。

Started POST "/tag/solstrip/synonyms" for 3.14.14.5 at 2020-02-29 12:07:28 +0000
Processing by TagsController#create_synonyms as */*
  Parameters: {"synonyms"=>["solstrips"], "tag_id"=>"solstrip"}
Completed 500 Internal Server Error in 46ms (ActiveRecord: 0.0ms | Allocations: 6385)
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_topic_tags_on_topic_id_and_tag_id"
DETAIL:  Key (topic_id, tag_id)=(14651, 310) already exists.
)
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-1.1.6/lib/patches/db/pg.rb:69:in `exec_params'
Failed to handle exception in exception app middleware : PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_topic_tags_on_topic_id_and_tag_id"
DETAIL:  Key (topic_id, tag_id)=(14651, 310) already exists.

有人能确认一下这个问题吗?如果可以的话,也许可以将其移到 #bugs 分类?谢谢!

4 个赞

是的,这个问题也出现在我们的 Discourse 安装中。

1 个赞

已确认此问题在最新代码中仍然存在。

5 个赞

@vinothkannans 你能处理一下这件事吗?

2 个赞

此问题已在以下提交中修复

7 个赞