Messages from contact going to wrong thread after DB update; All Media is missing media
I have:
- [x] searched open and closed issues for duplicates
- [x] read https://github.com/WhisperSystems/Signal-Android/wiki/Submitting-useful-bug-reports
Bug description
Messages from contact are showing in the incorrect thread. I'm guessing, from the timeline of events, that this is due to the database migration. Here's what happened, near as I can tell.
- Sometime during the night, Signal updated to the new beta 4.16.3
- Later, a contact messaged me in Signal twice. The first was just text, the second was an image.
- Even later, when I woke up in the morning, I saw I had a message and opened Signal. It performed a database migration first thing.
- I now have two threads for this contact (before, I only had one). The thread that contained the new message was incorrect (this thread was to a different person and not a group chat), and was a really old, archived SMS thread with another contact many months ago. (You can also tell this via the colors in the screenshot.)
Other things I've noticed after this bug occurred
- Viewing "All Media" in either thread now only displays the new image I received last night. Scrolling through the correct thread, there are still plenty of images that should be displaying. Yet again, this bug seems to be regulated to just the one contact; other threads display All Media correctly.
- I responded to the contact in the correct thread, and the reply came in the incorrect thread. It is not displayed at all in the correct thread.
- Other contacts seem to be working fine so far. The only one that is broken is the one that messaged me after the upgrade, but before the DB migration.
Actual result: Contact's messages appearing in wrong thread, media in correct thread now longer showing in All Media Expected result: Contact's messages appear in the correct thread, and all media displays the correct amount of media.
Screenshots

Device info
Device: Pixel XL (Marlin) Android version: 8.1.0 Signal version: 4.16.3
Link to debug log
https://gist.github.com/5a29ff88469a898ab617445659067a76
To confirm, you have a Signal screen lock password set?
That is correct. Sorry, I forgot to mention that.
On February 3, 2018 8:07:55 PM EST, Moxie Marlinspike [email protected] wrote:
To confirm, you have a Signal screen lock password set?
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/signalapp/Signal-Android/issues/7390#issuecomment-362870992
This is a pretty major oversight on my part; anyone who has a Signal screenlock password set and receives a new message after receiving the update, but before unlocking the app one time, is going to have this problem.
I have a fix (for those who haven't updated yet) that I won't be able to test until later. Unfortunately, I think the only way for you to recover is to completely delete the both "threads" with this contact. =(
Really sorry! Thanks for being a beta tester.
Hey, no problem. That's why you have beta testers! I'm glad my bug report helped those on stable. I presume I should leave this open so it can be linked to a PR then?
Can I just delete all the messages from the person who messaged after the upgrade instead of deleting all long-standing message history from the conversation it merged with?
I just had the same thing happen on 4.16.5. I thought this was fixed?!
I'm also not a beta tester, I just double checked in the Play store.
My debug log: https://gist.github.com/894b7ec516da2f33e1215fc79a5d59d8
@stephzylstra There is no migration in this debug log. Are you saying you were running 4.15.x, upgraded to 4.16.5, have a passphrase set, received a message before unlocking Signal for the first time, and are now seeing messages from multiple people in the same thread?
I'm not sure what I was running, I'm guessing 4.15.x because I have automatic updates enabled, but I'm now definitely on 4.16.5.
I have the exact symptoms described in this issue, including the database migration screen - it took maybe 45 seconds on my phone.
When the person whose conversation got taken over by someone else messaged me later, that started a new thread with none of the previous history.
@stephzylstra Can you please describe in your own words exactly what you are experiencing as clearly as possible? For instance, by "the exact same symptoms," do you mean that you have a Signal screenlock passphrase set, and received a message after upgrading but before enter your Signal passphrase the first time?
Yes, that's exactly right.
I woke up this morning to find a notification from Google Play that Signal had been updated. I cleared the notification but didn't open the app.
Later, I got an SMS message from E. Signal is my SMS app, so this showed the locked message notification. I tapped on this message and was taken to the Signal unlock screen. After entering my passphrase, I got a message about the database being upgraded, with a progress bar. This took about 45 seconds, and then showed me a conversation where the last message was from E (the new message). I wasn't really paying attention at this stage, so I am unsure whether this was an existing conversation with E or not. I replied to E's message from the same conversation where I saw it.
After replying, I noticed that the earlier messages in that conversation were actually from another contact, O. (Both contacts are displayed in blue, so it was not glaringly obvious.) It is not a group conversation and the coloured header bar at the top of the conversation shows it as being a conversation with E. The screenshot I have of this is fairly similar to the one originally posted in this thread, but I can repost later if needed. There was also no conversation labelled O at that point.
When I go to the conversation settings for the conversation which is labelled E but mostly contains messages with O, the media gallery contains media from conversations with both E and O.
I asked O (offline) to message me on Signal. When he did so, this started a new conversation (labelled O), without any of the previous history. New back and forth messages to O remained in this conversation.
I also located the original conversation for E and sent an SMS from there to check who received it. The reply, from E, came to the conversation which is labelled E but contains O's history - that is, not the conversation from which the message was sent. The conversation history in E's original thread shows MMS previews of images sent to/from E, but doesn't allow to load them fill screen - it's just blank.
Does that make sense? Anything you need me to clarify?
Thank you for the excellent description! Is it possible that O is one of the original people you communicated with in this install of Signal?
O is the person I communicate with most frequently on Signal, and messages with him were the most recently received/sent prior to the database update. However, this morning I messaged O only after noticing the error.
So far, the only people I have communicated with via Signal since the update are E and O.
@stephzylstra I understand what's happening now, the fix for what @TheCraiggers reported only applied to signal messages. You received an SMS from E, which triggered the same thing. =(
I've just experienced the same thing.
Having upgraded Signal about 10 hours ago, I didn't open it for it to run migrations. The version information now says it's 4.16.7, not sure what I had before. A little while ago I received one SMS and one signal message from two different contacts. Seemed a bit weird to me as to how I would receive two messages from two different people at the same time. Having password lock, I unlocked the app to see an upgrade progress bar move across the screen. Didn't take long, but afterwards I find a really long conversation being overwritten with the contact I received message from just now.
Phone is Nexus 5X, Android 8.1.0.
@zejn please include a debug log to your report. Otherwise moxie will not be able to do anything.
Here is how you can do that: https://support.signal.org/hc/en-us/articles/212535838-How-do-I-send-a-debug-log-from-Signal-Android-
Would gladly, but I've messed a bit too much with the app so there's no debug log covering that time anymore.
@zejn Could you try to describe what you experienced in a little more detail? Which contacts sent you which kind of messages, and which contacts appeared in merged messages? Did you see a notification prompting you to open the app to complete the migration before those messages arrived?
I received two messages at about the same time, one was SMS from contact A, the other was signal message from contact B. The SMS from contact A was merged with conversation with contact C, which was definitely not the last contact who I messaged with ... but it might actually be the first one, now that I think. If I remember correctly there was an "okay do it" button that database needs to be upgraded, but that was in the app, I don't remember seeing a notification with that.
I don't know how migration is made, but from what I experienced I'd imagine you create a new database file and go about inserting records from previous database, and the SMS somehow squeezed in between and got the first conversation id, which coincided with another already existing conversation.