tijder / SmsMatrix

A simple SMS <--> Matrix bridge.
https://matrix.to/#/#smsmatrix:matrix.org
GNU General Public License v3.0
214 stars 37 forks source link

Multiple rooms created for same phone number #13

Open tijder opened 6 years ago

tijder commented 6 years ago

If two sms are received close after each other. Then the app can't find a room with the phonen number even it just created one. Receiving a sms when the app is starting will also not find the correct room.

Gredin67 commented 6 years ago

Maybe I never got close-enough SMS but I never encountered this duplication issue. Has it been solved in between?

ghost commented 5 years ago

This bug is because of Line 186 in Matrix.java file

Line 186 is asynchronous and will run in the background to set the topic. In my experience will take ~5 seconds to complete. If you receive a new message while line 186 setting the topic line 160 will see a room with no topic and start to create a new room.

I have no idea how to fix it but I'm trying. I've never programmed with Java or Android before. I want to make line 186 synchronous and block other threads from entering sendMessage. No sure if that's a good idea or how it should be done.