ocsms icon indicating copy to clipboard operation
ocsms copied to clipboard

Contacts not matching numbers

Open rushsteve1 opened this issue 7 years ago • 11 comments

Steps to reproduce

  1. Have a contact with a phone number formatted like: "1234567890"
  2. Sync SMS
  3. Contact does not match message chain because it synced as "123-456-7890"

Expected behaviour

Contacts should fuzzy match message chains. Small differences in formatting like "1234567890" and "123-456-7890" or "+11234567890" (country code) act as if they are entirely different numbers.

Actual behaviour

Contacts do not match when the number has small differences in formatting. The conversation just appears listed under the number.

Server configuration

NextCloud/ownCloud version: 11.0.2

PHP version: 7.0.14

HTTPd server: Apache

HTTPS: Yes (LetsEncrypt)

Client configuration

Android version: 7.1.1

Phone: Nexus 6P

ownCloud SMS app version: 0.24.1 (F-Droid)

Logs

N/A

rushsteve1 avatar Mar 13 '17 14:03 rushsteve1

We have some problems with the contact deduplication sometimes...

nerzhul avatar May 12 '17 09:05 nerzhul

Hi,

Any update regarding to this problem?

I have some contacts with phone number formatted like "+1234567890" and they are synched as "1234567890" and "+1 234 567 890" or "+1 (234) 567 890". The idea is that one single contact is synched as 2 different sms_address.

On the UI, the sms_address "+1 (234) 567 890" appears as "+1(234)567890" (Note the missing spaces) and when I select it, it says that "0 message(s) shown. 0 message(s) stored in database."

Thanks, kukukk

kukukk avatar Jul 17 '17 19:07 kukukk

I too have this problem. It is particularly problematic when the phone number is different between sent and received messages, and then there are separate tabs for each side of a conversation.

[Edit my country code was set wrong, apparently it defaulted to Afghanistan. More contacts link up properly, but I'm still getting split conversations though]

bruceg avatar Nov 15 '17 22:11 bruceg

@bruceg it's not simple intl phone number are sometimes different from local country number + prefix...

nerzhul avatar Nov 15 '17 23:11 nerzhul

I was looking at the code and decided to spend some time to see if I could improve the phone number formatting. Long and short of it is that the current regex based method seems pretty hard to fix.

So I did some searching and found libphonenumber which is a port of Google's phone parsing library to PHP and it seems to handle things quite a bit better (at least for NANP numbers, it will need some testing for the rest of the world of course :wink:).

I've forked the code and will open a PR with my changes.

toolstack avatar Jun 12 '18 21:06 toolstack

Any info when your pull request will be merged and released?

kukukk avatar Jun 25 '18 21:06 kukukk

should be fixed by recent release

nerzhul avatar Jun 26 '18 19:06 nerzhul

Still has problem with phone numbers formatting in phone sync I see sms in form +7XXXXXX-XX-XX and in contacts same number formatted like +7XXXXXXXXXX

Phone Sync 2.1.1

lupin-de-mid avatar Dec 27 '18 23:12 lupin-de-mid

Same issue here. Received sms are seen as +33 which makes them being in a differenct contact

farfromrefug avatar Oct 19 '19 12:10 farfromrefug

random passerby : is this still an issue? did someone forget to close this issue after it was fixed in https://github.com/nextcloud/ocsms/releases/tag/1.13.0 as mentioned in https://github.com/nextcloud/ocsms/issues/176#issuecomment-400429053?

Also #121 looks like a duplicate of this issue as well. If they are already fixed, can someone close both these issues?

shinenelson avatar Jan 15 '21 15:01 shinenelson

Number matching was significantly improved though PR #241 but there are still corner cases that exist, hence why this was left open (to my recollection at least).

toolstack avatar Jan 15 '21 17:01 toolstack