Cannot delete tags

Your software
My Mautic version is: 4.02
My PHP version is: 7.4
My Database type and version is: MySQL 8+

Your problem
My problem is: Cannot delete tags

These errors are showing in the log: None

Steps I have tried to fix the problem: Unable to figure out the steps to fix

A bunch of tags was created and I don’t know how that happened so I went to delete it but it kept giving me something about tag need to be remove from contact before deleting

This is a new install and I have created a few contacts and delete it all. I can’t seem to delete the tags and it’s showing it still tied to 1 contact when I have none left in Mautic.

What preventing me to delete those tags?

I noticed one thing when I was creating one of the tag, I kept renaming it by backspacing it and it look like it create one new tag for each backspace on my Mautic

Maybe a bug?

Seems to be a bug when I deleted a contact the tags are not updated I think

I add a couple of contacts for testing purpose and deleted it. The contact number on a tag just doesn’t reset or go down when contacts with its’ tag are deleted.

There seem to be a bug with tag because when I created segment using tag filter. It counted the contacts that was deleted. Segment shows 6 contacts found with the tag when there is only 3 names in contact.

I am still testing it out so I only have 3 contacts stored in it. I had 6 and I deleted the 3.

I managed to fix it …

I created a campaign using a tag that had invisible contacts on it (ones I deleted earlier)

Then on campaign page, I clicked on Contact TAB and it list all the contacts that are assigned to this campaign with the tag including the invisible ones. The missing on had no name on it but where name normally are had my ip address in it.

I edited those invisible contacts adding Bug One, Bug Two, and Bug Three as the names then I went to contact page and deleted it again. This time it removed the contacts from the tags.

Now I can start deleting tags

However I still don’t know how the tag creation bugged out since it seem to be creating a new tag at each of the keystroke and backspace as you can see in the earlier screenshot.

And I still don’t know why deleting the contacts did not remove contacts for those tags which was assigned to it after deletion either.

If I managed to reproduce it somehow, I will do a bug report on git.

Looks like that the contacts I deleted didn’t really get removed from database instead it get converted into anonymous contacts.