Deleting tag synonym deletes tag

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’.

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.