Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing a RawContact's Group memberships may not work and may result in the deletion of incorrect arbitrary data #208

Closed
vestrel00 opened this issue May 17, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@vestrel00
Copy link
Owner

vestrel00 commented May 17, 2022

Problem

Performing an update operation on a RawContact (or the parent Contact) and you have removed one or more group memberships from the RawContact, then for each group membership removed...

  • the group membership may not be deleted
  • arbitrary data (e.g. email, phone, relation, etc) may get deleted instead

For example, given the following rows in the data table;

## Data table (group membership rows, data1 refers to the groupId)
Data id: 1, data1: 3
Data id: 2, data1: 4

## Data table (arbitrary data rows, which could be email, name, etc)
Data id: 3
Data id: 4

If the Update or ProfileUpdate API are used such that the group membership with data id of 1 is removed from RawContactEntity.groupMemberships, then the data row with id of 3 is deleted instead of data row with id of 1.

The reason this occurs is because, in code, the groupId is mistakenly used to delete a data row id 🤦 🤦 🤦 🤦 🤦

Screen Shot 2022-05-17 at 12 50 37 PM

Solution

Delete the data row with the corresponding group membership data row id instead of a group id... lol

@vestrel00 vestrel00 added the bug Something isn't working label May 17, 2022
@vestrel00 vestrel00 self-assigned this May 17, 2022
@vestrel00 vestrel00 added this to In progress in Consumer issues May 17, 2022
@vestrel00 vestrel00 moved this from In progress to Done in Consumer issues May 17, 2022
@vestrel00
Copy link
Owner Author

This is included in release 0.2.1!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant