In fact, I have encountered many situations where messages are missing.
My solution is as follows: in a group of multiple people, each device should not only send a timestamp, but also tell other devices the sequence number of the message they sent themselves (each device has its own independent sequence number, arranged in a certain order).
In this case, normal message records should be arranged in a certain order.
When the message numbers of a certain device are not consecutive, we know that the device has failed to send certain (determined) messages.
So can this effectively solve the synchronization problem?
We can set a separate serial number for each device, such as 130 million serial numbers, and then reuse them when the device runs out of serial numbers.
For example, A sent the first message, A sent the second message,
A sent the x-th message
Below is a special situation that I am thinking about.
Is there a situation where A, B, and C are in the same group.
When they are all online
A: 1
B: 2
C: 3
(All three messages were successfully sent, and then B and C went offline)
A: 4
(4 failed to send)
B and C are online simultaneously
B: 5
(5 successfully sent between B and C, then C went offline)
If A and B are both online, then 4 has also been successfully sent.
At this point, D, F, and G sent a lot of messages.
Will there be a device synchronizing the fourth message before C goes online?
This is my question. I encountered a situation yesterday where the message was not synchronized