Segment Membership Is Not Regenerated After Segment Filter Rule Changes

Hello,

I’m running Mautic 6.0.2

Scenario 1 - Working
I create a new segment and add a filter. I add one rule - tag includes mytag.
I add the mytag to the contact.
When the segment update cron job runs the segment contact count and membership is now one.
I then remove the mytag from the contact.
When the segment update cron runs, the contact is removed from the segment.
Contact count and membership is now zero.
All well and good.

Scenario 2 Not Working
I create a new segment and add a filter. I add one rule - tag includes mytag.
I add the mytag to the contact.
When the segment update cron job runs the segment contact count and membership s now one.
I delete the segment filter rule completely.
When the segment update cron job runs the segment contact count and membership is still one.
If I remove the tag from the contact and wait for the cron job to run.
The segment contact count and membership is still one.
There are no errors in the logs.

Therefore Mautic does not appear to be re-calculating segment membership when the segment rules are changed. The membership and count remains the same after all segment rule changes.

If you are making segment rule changes please be aware that segment memberships does not appear to be regenerated which is a critical problem.

The issue is totally repeatable on a test 6.0.2 instance of Mautic.

Thanks.

Hi, just to be clear:
“I delete the segment filter rule completely.” - do you have a segment without a rule?
Either way, this seems to be a bug.
Joey

Hello joeyk,

To clarify:

I create a segment.
I add rules to the segment.
The cron job runs.
I verify the correct contacts are added to the segment.
I deleted all the rules from the segment.
The segment exists with no rules.
However the segment number of contacts does not get cleared to zero.
If you click the contact button, the contacts are still listed from the previous rules even though the rules have been deleted.

I think that when the segment gets rules and then they are deleted, the segment does not appear to clear the segment membership back to zero etc …

If you re-add more rules then i think it regenerates contact membership correctly again.

Yes there appears to be some sort of bug there.

Thanks.

For sure a bug. It should remove all members. Thanks for pointing it out. Did you report it by chance?

Hello joeyk,

The Mautic documentation says report or discuss problems and bugs on the forum.

If you briefly tell me how to report the bug properly, I assume on github, I will certainly do so. Or you are welcome to do it if that’s quicker, I don’t mind.either way ?

Thanks.