You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 26, 2026. It is now read-only.
This report is AI-generated and may be nonsense. However it came up during refactoring and I don't want to forget it so it's tracked here.
Bug
RawContactBuilder always adds GroupMembershipBuilder.Factory to its default list, regardless of the address book's groupMethod.
AndroidContact.update() uses RawContactBuilder.builderMimeTypes() to build a delete-selection that removes all existing data rows of the managed MIME types before re-inserting them. Because GroupMembership.CONTENT_ITEM_TYPE is always included in that set, all group membership rows are deleted on every contact update.
In GROUP_VCARDS mode, GroupMembershipBuilder.build() returns no rows (memberships are managed exclusively via AndroidContact.addToGroup() / removeGroupMemberships()), so deleted memberships are never restored. This leads to contacts losing all their group memberships whenever they are updated from the server.
Expected behavior
Group membership rows should only be deleted and re-inserted by RawContactBuilder in CATEGORIES mode, where categories are mapped to/from group memberships. In GROUP_VCARDS mode, GroupMembership.CONTENT_ITEM_TYPE must not appear in builderMimeTypes().
Possible fix
Only register GroupMembershipBuilder.Factory when groupMethod == GroupMethod.CATEGORIES.
Warning
This report is AI-generated and may be nonsense. However it came up during refactoring and I don't want to forget it so it's tracked here.
Bug
RawContactBuilderalways addsGroupMembershipBuilder.Factoryto its default list, regardless of the address book'sgroupMethod.AndroidContact.update()usesRawContactBuilder.builderMimeTypes()to build a delete-selection that removes all existing data rows of the managed MIME types before re-inserting them. BecauseGroupMembership.CONTENT_ITEM_TYPEis always included in that set, all group membership rows are deleted on every contact update.In
GROUP_VCARDSmode,GroupMembershipBuilder.build()returns no rows (memberships are managed exclusively viaAndroidContact.addToGroup()/removeGroupMemberships()), so deleted memberships are never restored. This leads to contacts losing all their group memberships whenever they are updated from the server.Expected behavior
Group membership rows should only be deleted and re-inserted by
RawContactBuilderinCATEGORIESmode, where categories are mapped to/from group memberships. InGROUP_VCARDSmode,GroupMembership.CONTENT_ITEM_TYPEmust not appear inbuilderMimeTypes().Possible fix
Only register
GroupMembershipBuilder.FactorywhengroupMethod == GroupMethod.CATEGORIES.