This issue was happening because of special category security permissions for staff group. We add invited user to restricted group when they are invited to a group restricted category topic by staff or group owner. But in this case adding invited user to an automatic group was a legitimate bug. Even though the invited user was getting removed from automatic groups after every 12 hours via EnsureDbConsistency job but this should not be happening in the first place.
Also note that this issue was not specific to bulk invite feature. It was also happening when inviting user to a topic (using “Invite” button at the bottom of the topic).
Now fixed via:
https://github.com/discourse/discourse/commit/c8bc942333f5cb0920a18d98b9f8b1baab2c9749
Thanks a lot for reporting this issue and providing necessary information for debugging @husseinhilmi. ![]()