signalapp / Signal-Android

A private messenger for Android.
https://signal.org
GNU Affero General Public License v3.0
25.59k stars 6.14k forks source link

Message received timestamp is from a future time. #2439

Closed git12a closed 6 years ago

git12a commented 9 years ago

My phone's time and my friend's are both set correct. Yet, his messages to me seem to be coming from a time about 4 hours 50 minutes from the future. Even in info box, sent time is ahead of received time. This lets a bad experience when I don't check phone for some hours, and then try to know how long ago the message was received. (both of us run latest textsecure with all system updates till 4.4.4, living in same timezone)

jeremymasters commented 9 years ago

It might be good for the developers to know what brand of phone you have too.

agrajaghh commented 9 years ago

Was it a SMS or push message?

mcginty commented 9 years ago

Yeah, if the sender's phone has a clock that's in the future, the receiver will believe the push message's timestamp regardless of its physical plausibility ;). If we set a ceiling on the incoming timestamp to be at most the receiving device's clock, then we assume the receiving clock is correct, though...

moxie0 commented 9 years ago

OP is saying that the clocks are in sync.

git12a commented 9 years ago

It is for push messages only. Yes, clocks are in sync, and in same timezone, same city, same ISP. @mcginty what if Textsecure gets its own clock, from a server that tells time, and set timezone determining from IP-geolocation of user? (This way it will not matter if system clock is wrong, but I wonder people rarely keep system clock wrong, because most people see time from lock screen)

johanw666 commented 9 years ago

An own clock? IP geolocation with all privacy issues and possible errors with that (when I'm on company wifi I suddenly live in another country according to geolocation)? Seems a lot of work to solve a non-problem.

BTW, how far in the future are those messages? days, minutes, or exactly a (few) hours? If it's the last option, perhaps timezone settings on the device might be the cause.

oezgueremir commented 9 years ago

I had the same issue, but it was definitely caused by a wrong timezone setting on the sending device. After he set the correct timezone everything was fine. Are your messages getting "from far past" to your friend? If you send now, does he receive a message form 4 hours in the past? Have you tried playing with the clock? E.g. set the clock on sender 2 hours in the future, does that affect the message timestamp aswell? I don't know, i still assume a wrong setting on the phone. Is a alternate time configured? Am 11.02.2015 17:07 schrieb johanw666 notifications@github.com:An own clock? IP geolocation with all privacy issues and possible errors with that (when I'm on company wifi I suddenly live in another country according to geolocation)? Seems a lot of work to solve a non-problem.

BTW, how far in the future are those messages? days, minutes, or exactly a (few) hours? If it's the last option, perhaps timezone settings on the device might be the cause.

—Reply to this email directly or view it on GitHub.

git12a commented 9 years ago

It happens to only one of my friends using TS, I did verified his time and mine, also timezone. Anyway I get all his messages. It's an isolated issue, I guess, since I can't see same issue with other friends.

Problem not repeatable to me even, so we can close this issue.

mcginty commented 9 years ago

Does your friend have an uncommon phone or Android ROM that might have a timezone-related bug?

git12a commented 9 years ago

@mcginty No, he has a popular phone with Stock ROM.

we set a ceiling on the incoming timestamp to be at most the receiving device's clock, then we assume the receiving clock is correct, though...

I think setting this ceiling is a good solution. The assumption on receiving clock's correctness also seems to be proper assumption because that's what the user is expecting : "If my phone's system time is wrong, then the timestamp on messages is also correspondingly wrong" ... This will also avoid the scenario where to an user it seems like he got message from the future ;) .. (because if he sees a message with future time stamp, he first checks the phone's system time)

2-4601 commented 9 years ago

What is the expected behavior when you receive a push message from a contact who is in a different timezone?

I got a message that seems to be stuck on Now because it was sent from an earlier timezone.

More background: There's a 6 hour difference in the timezones. Yet the time difference TS shows is only one hour. Both countries use Daylight savings time. My friend uses Signal.

agrajaghh commented 9 years ago

the time and timezone on your friends phone are correct?

2-4601 commented 9 years ago

The timezone was adjusted automatically by iOS when he changed country but it turned out that daylight savings did not change automatically and had to be manually adjusted. Hence the one hour difference. So this had nothing to do with Signal/TextSecure, just collateral damage :)

rhodey commented 9 years ago

related but opposite problem, just received three messages in the same conversation all being sent within 15 seconds of each other. the first has the correct time stamp while the 2nd and 3rd have a receipt time of 7 hours ago.

order of events as I remember.

1) lock TS on my N5 2) send message 1 from my GB device 2) receive message 1 on my N5 3) unlock TS on my N5 4) received decrypted message 1 on my N5 5) send message 2 & 3 on GB device 6) receive message 2 & 3 on my N5 7) notice that M1 read "Now" while M2 & 3 read "Mon 6:16"

screen: screen debug log: https://gist.github.com/anonymous/2864c819949f028fe156

I don't think these traces are related to the issue reported but @moxie0 should probably check them out as it seems like some strange server behavior:

E/AndroidRuntime( 5666): FATAL EXCEPTION: JobConsumer-1
E/AndroidRuntime( 5666): Process: org.thoughtcrime.securesms, PID: 5666
E/AndroidRuntime( 5666): org.whispersystems.textsecure.internal.util.JsonUtil$JsonParseException: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
E/AndroidRuntime( 5666):  at [Source: <html>
E/AndroidRuntime( 5666): <head><title>411 Length Required</title></head>
E/AndroidRuntime( 5666): <body bgcolor="white">
E/AndroidRuntime( 5666): <center><h1>411 Length Required</h1></center>
E/AndroidRuntime( 5666): <hr><center>nginx/1.1.19</center>
E/AndroidRuntime( 5666): </body>
E/AndroidRuntime( 5666): </html>
E/AndroidRuntime( 5666): ; line: 1, column: 2]
E/AndroidRuntime( 5666):    at org.whispersystems.textsecure.internal.util.JsonUtil.fromJson(JsonUtil.java:44)
E/AndroidRuntime( 5666):    at org.whispersystems.textsecure.internal.push.PushServiceSocket.makeBaseRequest(PushServiceSocket.java:503)
E/AndroidRuntime( 5666):    at org.whispersystems.textsecure.internal.push.PushServiceSocket.makeRequest(PushServiceSocket.java:445)
E/AndroidRuntime( 5666):    at org.whispersystems.textsecure.internal.push.PushServiceSocket.acknowledgeMessage(PushServiceSocket.java:183)
E/AndroidRuntime( 5666):    at org.whispersystems.textsecure.api.TextSecureMessageReceiver.retrieveMessages(TextSecureMessageReceiver.java:129)
E/AndroidRuntime( 5666):    at org.thoughtcrime.securesms.jobs.PushNotificationReceiveJob.onRun(PushNotificationReceiveJob.java:36)
E/AndroidRuntime( 5666):    at org.whispersystems.jobqueue.JobConsumer.runJob(JobConsumer.java:76)
E/AndroidRuntime( 5666):    at org.whispersystems.jobqueue.JobConsumer.run(JobConsumer.java:46)
E/AndroidRuntime( 5666): Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
E/AndroidRuntime( 5666):  at [Source: <html>
E/AndroidRuntime( 5666): <head><title>411 Length Required</title></head>
E/AndroidRuntime( 5666): <body bgcolor="white">
E/AndroidRuntime( 5666): <center><h1>411 Length Required</h1></center>
E/AndroidRuntime( 5666): <hr><center>nginx/1.1.19</center>
E/AndroidRuntime( 5666): </body>
E/AndroidRuntime( 5666): </html>
E/AndroidRuntime( 5666): ; line: 1, column: 2]
E/AndroidRuntime( 5666):    at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1486)
E/AndroidRuntime( 5666):    at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:518)
E/AndroidRuntime( 5666):    at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:447)
E/AndroidRuntime( 5666):    at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1462)
E/AndroidRuntime( 5666):    at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:683)
E/AndroidRuntime( 5666):    at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3600)
E/AndroidRuntime( 5666):    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3545)
E/AndroidRuntime( 5666):    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2576)
E/AndroidRuntime( 5666):    at org.whispersystems.textsecure.internal.util.JsonUtil.fromJson(JsonUtil.java:41)
E/AndroidRuntime( 5666):    ... 7 more
robrill commented 7 years ago

i'm getting messages stamped ~5 hours into the future in a group on signal for ios, all group members are in the same city and all our phone clocks are showing the same time. all group members are getting the wrong timestamps. no access to logs, sorry

jeremymasters commented 7 years ago

if they are all ios, should you put this in the ios section?

robrill commented 7 years ago

sorry--the group is a mix of ios and android and the issue is occurring on both platforms

jeremymasters commented 7 years ago

Do you have access to your own logs?

schmeat commented 7 years ago

I am having this issue as well. My friend is visiting another country with a different time zone. His messages show as being sent 2 hours ago, despite being sent at the same time as mine. The time zone difference is 2 hours. We are both using stock roms for our phones. Every member in this group chat is on Android.

Friend's (phone with issue) logs: https://gist.github.com/82d2de9458370bc2d78595f65a24ce4f

My logs: https://gist.github.com/anonymous/dd2cfe5e49131f7c28ccb7a58808e7ce https://gist.github.com/anonymous/ef07c3ae3e451cee2b4db35660582dab

Other group member's log: https://gist.github.com/514266681a6b8d9e078e024a4fef8504 https://gist.github.com/d1ad122fa062ad0729c4ce5e4184b369

automated-signal commented 6 years ago

GitHub Issue Cleanup: See #7598 for more information.