SimpleMobileTools / Simple-SMS-Messenger

An easy and quick way of managing SMS and MMS messages without ads.
https://www.simplemobiletools.com
GNU General Public License v3.0
610 stars 218 forks source link

Wrong MMS notifications #278

Closed tswistak closed 2 years ago

tswistak commented 2 years ago

Hi,

I've encountered a rather strange issue regarding handling MMS messages. Notification about new message doesn't show the message I've just got, but some random previous one. I've checked in on two mobile phones and results were like this:

Of course, I don't have an ability to show you this issue on video (it's personal stuff and emulator doesn't support MMS). However, it should be easy to reproduce. We both have Android 11 phones without custom ROMs.

tibbi commented 2 years ago

right, seems to have happened to me too, MMS shows a wrong sender, clicking it opens a wrong thread. It used to work well not that long ago. Maybe @Aga-C can look at it? :)

Aga-C commented 2 years ago

From what I've quickly found out, the problem is in MmsReceiver with the line val mms = context.getLatestMMS() ?: return. When receiving MMS, the ID of fetched MMS by this function is different from the one in messageUri. This function wasn't changed for nearly 2 years, so either it's something wrong with the latest Android versions, or it wasn't working before. Right now, I don't have any idea how to fix it properly, because it looks like this new MMS doesn't exist in DB yet when notification is received. Maybe it would be possible to use messageUri somehow?

tibbi commented 2 years ago

right, not sure, I wasnt researching it. Wasnt this also unexpectedly broken by updating kotlin to 1.6.0? Can you do a quick test and revert it to 1.5.31?

Aga-C commented 2 years ago

I will check it in the evening.

Aga-C commented 2 years ago

Unfortunately, it's not related. I've reverted to the commit before upgrading Kotlin version and there was the same bug.

tibbi commented 2 years ago

okay, will take a look at it someday then I guess. First it is important to figure out when did it break by checking old versions. It was working not that long ago. Thanks