Deleting tag synonym deletes tag

סיכום מבוסס בינה מלאכותית

Simon_Manning reported a critical bug in Discourse version 2026.2.0-latest (7e603d4374) where deleting a tag synonym inadvertently deletes the primary tag itself. The issue occurs when merging tags: after adding a synonym and then removing it via the trashcan icon, both the synonym and the original tag are deleted from the database. Simon_Manning noted that the deletion logs lack necessary details, such as the topic IDs affected, and no topic edit records are created, hindering forensic analysis. However, in a follow-up post, Simon_Manning confirmed that the issue does not reproduce in the latest commit (2026.2.0-latest f6d8f1a458), suggesting the bug was resolved by a subsequent tag-related commit. sam acknowledged this possibility and advised the user to flag the issue for reopening if the problem persists in their environment.

Attempting to merge two tags and remove the incorrect one, I created, then deleted a synonym which resulted in both tags being deleted.

Discourse version: 2026.2.0-latest (7e603d4374)

Steps to reproduce:

  1. Create a new topic
  2. Give it two tags, tag1 and tag2, and submit it
  3. Click tag1 to navigate to tag filter page
  4. Click the wrench to open tag settings
  5. Click Edit Synonyms
  6. Add tag2
  7. >> At this point tag2 is removed from the created topic
  8. In the list of synonyms, click the small trashcan icon beside tag2
  9. Choose yes when prompted to remove the synonym
  10. >> tag1 is deleted along with the synonym

I use two tags applied to a single topic in the steps for simplicity, this also occurs when the two tags are applied to two separate topics.

Additional notes:

The log entry for the deleted tag has no details, it could be useful for this to contain the topic IDs the tag was removed from as part of deleting it.

As far as I could tell, deleting a tag also creates no record of topic edits so I couldn’t use Data Explorer to find topics with updated_at > 'some time' or list revisions created after ‘some time’.

לייק 1

I looked through the commits since that version and couldn’t see anything directly related, however I’ve just confirmed that the steps as written do not cause this problem (they correctly delete synonym alone) when running 2026.2.0-latest (f6d8f1a458), i.e. the latest commit at time of writing.

Not sure if it was fixed as a side effect in one of the tag-related commits or if I am just being blind checking the commits.

Very possible, please flag to reopen if it is still an issue.

2 לייקים