you-apps / ConnectYou

Privacy focused contacts and SMS messenger app built with MD3
https://you-apps.net
GNU General Public License v3.0
517 stars 21 forks source link

Contact got stored in nowhere #231

Closed SuhasDissa closed 1 year ago

SuhasDissa commented 1 year ago

Steps to reproduce

  1. Open the app
  2. Move one or more contacts from 'Device' to 'Local'
  3. Then move them back to 'Device'

Expected behavior

The contact should be moved to 'phone' section of the stock contacts app.

Actual behavior

The contact is actually created in the phone's storage. and the ConnectYou app shows it properly.

However, in the stock android contacts app, the contact is not visible under the 'phone' section.

Connect You version

6.0

Android version

Android 12

Other details

All my contacts are stored in my google account. So in above step two, the contact got moved from google account to local.

After moving the contact back and forth the contact is now not inside the google account or the phone storage. But the contact is still there when I navigate to the "All contacts" section of the stock contacts app. (See screenshots)

Apart from all those issues, now I can't figure out a way to move the contact back to my google account. Apparently, the contact is not stored in the phone or the sim card.

Acknowledgements

Bnyro commented 1 year ago

I don't have any phone with Google services to test this on, I suspect we're using a different account type and account name than the Google contacts app. Can you try to debug what accountType and accountName are for contacts created by Google contacts? For reference: https://github.com/you-apps/ConnectYou/blob/main/app/src/main/java/com/bnyro/contacts/util/DeviceContactsHelper.kt#L96

SuhasDissa commented 1 year ago

BTW I'm using the stock Samsung contacts app.

I looked at the contact storage location. ConnectYou contact storage location is shown as Phone (DEVICE) And Samsung contacts app created contact storage location is shown as Phone Storage

Created by Contact You Created by Samsung contacts
Bnyro commented 1 year ago

What are they using as accountType then?

Bnyro commented 1 year ago

The stock android contacts app uses com.android.contacts, and so does Connect You.

SuhasDissa commented 1 year ago

In ConnectYou filter dialog there are 4 accounts. ConnectYou : DEVICE GoogleAccount : {My gmail address} Sim card (I assume) : 5190424673 SamsungContacts : vnd.sec.contact.phone

Bnyro commented 1 year ago

Interesting! If you set the type to your google account for example when creating a new contact in Connect You via the UI, does Google display it then? (Or the same with Samsung). Maybe we should allow users to also choose an account type when importing vcards and moving contacts from local to device.

SuhasDissa commented 1 year ago

Yes. choosing vnd.sec.contact.phone saves it into Samsung contacts. choosing my gmail saves it into my Google account.

Bnyro commented 1 year ago

Maybe we should allow users to also choose an account type when importing vcards and moving contacts from local to device.

So this should probably resolve the issue I assume?

SuhasDissa commented 1 year ago

BTW that random number thing is not the sim card. Those are the telegram contacts.

SuhasDissa commented 1 year ago

Maybe we should allow users to also choose an account type when importing vcards and moving contacts from local to device.

I think most people would find the account name vnd.sec.contact.phone to be a bit too technical. I doubt anyone would actually choose it

Bnyro commented 1 year ago

Well, but that's probably to only way to resolve that issue?

SuhasDissa commented 1 year ago

https://stackoverflow.com/questions/45768948/how-can-i-get-the-default-phone-and-sim-contacts-account-type-and-account-name