Fix #4483: Wrong order for BUR caused 12k mistags.

Bug: if a BUR contained a mass update followed by an alias, then the
alias would become active before the mass update, which could cause
the mass update to return incorrect results if both the alias and mass
update touched the same tags.

This happened because all aliases and implications in the BUR were set
to a queued state before the mass update was processed, but putting an
alias in the queued state effectively made it active.

The fix is to remove the queued state. This was only used anyway as a
debugging tool anyway to monitor the state of BURs as they were being
processed.
This commit is contained in:
evazion
2020-11-12 15:59:01 -06:00
parent cc64f8b7ee
commit 9a287cd71f
11 changed files with 56 additions and 50 deletions

View File

@@ -98,11 +98,11 @@ class BulkUpdateRequestProcessor
case command
when :create_alias
tag_alias = TagAlias.create!(creator: approver, forum_topic_id: forum_topic_id, status: "pending", antecedent_name: args[0], consequent_name: args[1], skip_secondary_validations: skip_secondary_validations)
tag_alias.approve!(approver: approver)
tag_alias.approve!(approver)
when :create_implication
tag_implication = TagImplication.create!(creator: approver, forum_topic_id: forum_topic_id, status: "pending", antecedent_name: args[0], consequent_name: args[1], skip_secondary_validations: skip_secondary_validations)
tag_implication.approve!(approver: approver)
tag_implication.approve!(approver)
when :remove_alias
tag_alias = TagAlias.active.find_by!(antecedent_name: args[0], consequent_name: args[1])