signalapp / Signal-Desktop

A private messenger for Windows, macOS, and Linux.
https://signal.org/download
GNU Affero General Public License v3.0
14.69k stars 2.68k forks source link

Messages missing for newly joined GV2 user #4593

Closed pgerber closed 3 years ago

pgerber commented 4 years ago

Bug Description

When a user joins a GV2 group while Signal Desktop is offline, then messages sent between joining and the desktop app syncing up again, are lost. That is, messages sent by the freshly joined user only.

I did not actually reproduce this but based on the events I've observed I'm rather confident that this is what happened.

Steps to Reproduce

  1. Close Signal Desktop
  2. Have another user join a GV2 conversation
  3. Have the user write some messages
  4. Start Signal Desktop

Actual Result:

Messages sent by the other user before Signal Desktop was started are missing in the conversation.

Expected Result:

All messages show up.

Screenshots

missing

This screenshot shows a reference to a message sent by not io just after joining but before I opened the Desktop app. This was what tipped me of that there was something wrong and when I checked, I found that three message sent by that user were missing.


missing2

On the right is the same Signal Desktop shown in the first screenshot. It shows that messages sent by not io arrived again after syncing up. On the left is a second Signal Desktop instance I started a bit later. There the message from not io was still missing.

Platform Info

Signal Version: 1.37.1-beta.2 (both of them)

Operating System: Debian 10 VM on Qubes OS

Linked Device Version: 4.74.1

Link to Debug Log

Signal Desktop started up first Signal Desktop started up second

scottnonnenberg-signal commented 4 years ago

Thanks for all the details on this. Signal Desktop will drop messages if you or the sender are currently not a member of the group. V2 Groups will always repair their state when you open them. So, the key bug here seems to be that Desktop didn't fetch the proper group state before processing that incoming message.

Can you go into the message details for the messages which arrived properly, and grab the 'sent id'? You have a lot of groupv2 events in your log, and I do see a number of dropped messages. I just need to narrow it down a bit.

pgerber commented 4 years ago

I'm part of the Break Signal for Science group that can be found in the community forum. All the people playing with GV2 keeps the group busy.

I looked at the conversation again on Android and I noticed that there were more than three messages that got lost, counting is hard. Also, I noticed that the user is actually called io (at the time) and that he was kicked out of the group a bit earlier, upon his request. I think the user wanted to test something.

Not sure what you meant by 'sent id', so I just grabbed the sender timestamp from Desktop and Android. I think this are the most relevant messages:

1603091051: last message before io was removed from group 1603104469: First message after re-joining via group link 1603128677: Last message missing on both desktop apps 1603130650.279: The message that arrived on one desktop but not the other

I still have another Signal Desktop linked that I haven't started yet and that's likely in a state where it'll drop io's messages. I could send you ~/.config/Signal Beta/ if that helps in your investigation. This is an account linked to my second phone that I only use for beta testing. So nothing highly confidential there. I'd rather not publish it on GitHub but if you let me know how to get a copy to you, I'll happily do so.

scottnonnenberg-signal commented 4 years ago

A fix for this is in the process of releasing to beta. Please let us know if you see this again!

scottnonnenberg-signal commented 4 years ago

A fix for this is now in beta and production.