cbitstech / Purple-Robot

Sensing and automation platform for Android.
Other
38 stars 19 forks source link

CommunicationEventProbe: phone # formatting leads to differing hash values for same phone #207

Closed estory1 closed 10 years ago

estory1 commented 10 years ago

PR 1.4.7. Repro uncertain and may be difficult, but here are my observations:

1) I received an SMS from A, with a U.S. phone number B formatted as "+12223334444". 2) I sent an SMS to A, with a U.S.phone number B formatted as "(222) 333-4444".

The CommunicationEventProbe reports both of these SMS events, as-expected. But, when the phone number is hashed prior to transmission, different hash values are generated.

For a researcher, the consequence is to make it appear that the PR user was in contact with two separate phone numbers, rather than one.

Probably want to format these prior to reporting (painful though that can be)...

audaciouscode commented 10 years ago

Formatting is already done via PhoneNumberUtils.formatNumber. The issue is whether I should add the leading 1 to numbers that are less than 9 digits long. This may make sense in the USA, but break spectacularly in other locales. I need to look into this more...

cbitstech commented 10 years ago

In other countries the + prefix is required as well. M

On Fri, Nov 15, 2013 at 5:41 AM, Chris Karr notifications@github.comwrote:

Formatting is already done via PhoneNumberUtils.formatNumber. The issue is whether I should add the leading 1 to numbers that are less than 9 digits long. This may make sense in the USA, but break spectacularly in other locales. I need to look into this more...

— Reply to this email directly or view it on GitHubhttps://github.com/nupmmarkbegale/Purple-Robot-Manager/issues/207#issuecomment-28563465 .

audaciouscode commented 10 years ago

Continuing to operate under the assumption that PhoneNumberUtils.formatNumber is sufficient for these purposes without falling down the rabbit hole of phone number formatting.