Conversations are split between two threads
Steps to reproduce
- Open the SMS app with the owncloud web interface (Issue is the same for all browsers)
- Different / multiple contact phone numbers entries? (I'm not sure this is the cause) 3.
Expected behaviour
Conversations with contacts appear in one thread.
Actual behaviour
I see two entries in the owncloud interface, one entry contains messages I've sent (It seems to contain all messages I've sent to that phone number) and another thread has the messages I've received from that number. It appears to be connected with the phone number, or something with the vcard contacts being imported with slightly different numbers.
examples 123-456-7890 vs (123)-456-7890 vs +11234567890
Server configuration
**ownCloud version: 9.1.1
**PHP version: 5.6
**HTTPd server: Apache (Debain Jessie)
HTTPS: Yes
Client configuration
Android version: 6.0.1
Phone: Xperia Z3
ownCloud SMS app version: 0.22.1
Logs
Error index Exception: {"Exception":"Doctrine\DBAL\Exception\DriverException","Message":"An exception occurred while executing 'DELETE FROM oc_ocsms_smsdatas WHERE user_id = ? AND sms_id = ?' with params ["username", 11604]:\n\nSQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction","Code":0,"Trace":"#0 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(116): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))\n#1 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(175): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'DELETE FROM oc_...', Array)\n#2 /var/www/owncloud/lib/private/legacy/db/statementwrapper.php(73): Doctrine\DBAL\Statement->execute(Array)\n#3 /var/www/owncloud/apps/ocsms/db/smsmapper.php(314): OC_DB_StatementWrapper->execute(Array)\n#4 /var/www/owncloud/apps/ocsms/controller/apicontroller.php(82): OCA\OcSms\Db\SmsMapper->writeToDB('username', Array)\n#5 [internal function]: OCA\OcSms\Controller\ApiController->push(8935, Array)\n#6 /var/www/owncloud/lib/private/AppFramework/Http/Dispatcher.php(159): call_user_func_array(Array, Array)\n#7 /var/www/owncloud/lib/private/AppFramework/Http/Dispatcher.php(89): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\OcSms\Controller\ApiController), 'push')\n#8 /var/www/owncloud/lib/private/AppFramework/App.php(110): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\OcSms\Controller\ApiController), 'push')\n#9 /var/www/owncloud/lib/private/AppFramework/Routing/RouteActionHandler.php(46): OC\AppFramework\App::main('ApiController', 'push', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)\n#10 [internal function]: OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)\n#11 /var/www/owncloud/lib/private/Route/Router.php(280): call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)\n#12 /var/www/owncloud/lib/base.php(891): OC\Route\Router->match('/apps/ocsms/pus...')\n#13 /var/www/owncloud/index.php(39): OC::handleRequest()\n#14 {main}","File":"/var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php","Line":115} 2016-10-29T18:40:36+00:00 Error PHP call_user_func() expects parameter 1 to be a valid callback, class 'OCA\OcSms\Db\Config' not found at /var/www/owncloud/lib/public/AppFramework/Db/Mapper.php#331 2016-10-29T17:34:03+00:00
It seems the conversation deduplication doesn't work as intended in your case. I add the bugfix label
@rykeon990: Could you please compare the numbers of the splitted conversations shown in the URL-bar and within the conversations below the contact name? Please post the shown number formats here with some anonymized numbers
@DJaeger
From the address bar at the top, the conversations that work (where all the messages are in a single thread) are of the form +1###XXX#### (country code, then 10 digit number). The conversations that are split have several different forms for the phone number: First: ###XXX#### (without the country code in one thread and with the country code in another thread) Second: (###)XXX#### (No country code and the area code is in parenthesis) For both cases, all messages received by that contact were in the thread with the country code and all messages I sent were in the thread without the country code OR the thread with the parenthesis around the area code.
Let me know if there's anything else you need.
Looks like you have not set a country in the settings. If you have one selected, please try to select another country and set it back.
I also thinkg @DJaeger diag is correct, can you tell us if it's okay ? Maybe i should add a notice to users if no country has been selected
@DJaeger @nerzhul The country code was selected. I changed the country, then changed it back and it still has the same problem.
I'm seeing the same thing. I get two conversations: one including the messages I sent, and the other are the messages I received. The only difference is that the messages that are sent to my phone show up with a +1 in front of the number.
(XXX) XXX-XXXX = messages I sent +1XXX XXX-XXXX = messages sent to my phone.
Looking back in the in the (XXX) XXX-XXXX file, this started happening after October 26. (meaning in the view for that number it shows both conversations up to October 26).
The country code is on the United States. I tried switching it to something else and back, and it doesn't fix the problem.
Just throwing out a guess here. It seems @gkleman and I are having similar cause and effect here, and it's the parenthesis in the contact's number. So is there a way to have the code recognize the phone numbers and group them regardless of parenthesis? i.e.
(123) 456-7890 same as +1(123) 456-7890 same as +11234567890
The conversations I have that are working correctly have the contact's phone number of the form +11234567890
Only conversations with a parenthesis are split between two threads.
I'm not sure that the parenthesis is the issue. I shouldn't have written the parenthesis in my example. I have split threads with 1234567890 and +11234567890. With the +1 being the messages received by my phone, and the no +1 being the messages sent from my phone. Also, looking back at the messages, this started after September 26 (not October).
I have the same issue. When I look at my synced sms. A lot of the conversations are split with each under a different number like. 800-123-456 and another thread for the same conversation under the thread +1-800-123-456. I wonder if the synced sms come in under each number randomly and owncloud can't have the same contact with a different number. Even if the different is a +1. I changed a contacts number (that had 2 conversation threads) to match the other conversation, but when i looked at the sms the contact name switched to the other thread instead of combining the 2 conversation threads.
I finally got around to setting this up on my OC. Same issue as described above. I have a couple of threads one that includes the +1 country code and one that does not. I tried changing country and then changing back. Any news on this?
@thefreezaboy the deduplication contact code is very sensible and these days i miss some time, i'm only on patching client app, but i hope i will get more time for server soon
Same issue, here.
I found a workaround. If you add the different phone number formats eg: +1000XXX000, (XXX) XXX-XXXX, ###XXX####, ext... to a contact, it will group them up in the same thread.
Thanks, that works. In my contacts, the numbers were the following format: 2223334444, putting a one in front 12223334444 did not make a difference. I have to put a +1 in front, so for each contact, I have two mobile phone numbers:
2223334444 +12223334444
And now it puts them together in the same page.
+1 having the same issue
I have one thread with messages I sent in the format (123)4567890 Then another thread with messages I received in the format +12345678901