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

Unable to delete multiple duplicate SIM contacts in one delete operation #261

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

Comments

@vestrel00
Copy link
Owner

vestrel00 commented Sep 6, 2022

Problem

Let's say that there are the following duplicate contacts in the SIM card;

name: apple, number: 123
name: apple, number: 123

Then, attempting to delete both entries in one delete operation will result in the deletion of only one entry.

Executing the following code,

val simContacts = Contacts(context).sim().query().find()
Contacts(context).sim().delete().simContacts(simContacts).commit()

will result in the deletion of only one entry of name: apple, number: 123.

This is due to the internal SimContactToDelete not holding a reference to the unique row ID and internally using Set (removes duplicates) for keeping references to it AND the fact that the IccProvider will only delete one duplicate entry for each delete operation.

Solution

Nuke SimContactToDelete and just use SimContact, which does use the id.

@vestrel00 vestrel00 added the bug Something isn't working label Sep 6, 2022
@vestrel00 vestrel00 self-assigned this Sep 6, 2022
@vestrel00 vestrel00 changed the title Unable to delete duplicate SIM contacts in one delete operation Unable to delete multiple duplicate SIM contacts in one delete operation Sep 7, 2022
@vestrel00
Copy link
Owner Author

This is included in 0.2.4!

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
None yet
Development

No branches or pull requests

1 participant