Bug #1058

avatar

Seen message become unseen on reconnect to server

Added by Felipe Sateler 3483 days ago. Updated 3457 days ago.

Status:Closed Start:05/22/2015
Priority:Urgent Due date:
Assigned to:avatarMirco Bauer % Done:

100%

Category:Frontend GNOME
Target version:1.0
Complexity:

High

Found in Version:

1.0~rc4

Votes: 1 (View)

Description

Time as of this bug report is 9:47. I have just seen all messages in smuxi, then closed the client and reopened it. Smuxi now helpfully shows me unseen messages, but there is a bug:

1. Unseen messages include some already-seen ones.

The attached screenshots display the behavior: first screenshot is smuxi right after it started, second screenshot shows that the unseen message was a part/join activity, and that it was old (as I had already seen all messages before 9:30 or so).

This is smuxi 1.0rc4 client on debian sid connecting to a smuxi engine 1.0rc4 on debian sid
On the engine computer:

% mono --version
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-10)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen

On the client computer:
% mono --version
Mono JIT compiler version 4.0.1 (tarball Tue May 12 15:39:23 UTC 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen

smuxi1.png - See the count in csound channel (121.7 KB) Felipe Sateler, 05/22/2015 03:04 PM

smuxi2.png - See that the message was old in csound channel (92.7 KB) Felipe Sateler, 05/22/2015 03:04 PM


Related issues

related to Smuxi - Bug #1057 Unseen message count includes part/join activity on reconnect Closed 05/22/2015
duplicated by Smuxi - Bug #1064 On reconnect to running smuxi-server the message counter is misleading Closed 05/28/2015

Associated revisions

Revision 699190829e795c03c98e259eb543e72b1860a1fd
Added by Mirco Bauer 3481 days ago

Frontend-GNOME: mark messages of current chat as seen on quit (refs: #1058)

The issue is that Smuxi only marks messages as seen when the user switches away
from the current chat. This does not happen if the user was following the
currently visible chat and then quits Smuxi. Thus Smuxi has to mark the messages
of the current chat as seen on quit.

Revision bff11a093e0e57184a54ee0860aa586036dd2746
Added by Mirco Bauer 3461 days ago

Engine: fixed storing last seen message / highlight correctly with smuxi-servers (closes: #1058)

On Mono the DateTimeKind gets lost during serialization of .NET remoting. When
this happens we store the timestamp in local time instead. Otherwise the
timezone offset will be applied again leading to incorrect values.

Revision d10feafd4ce65f9dff79fa4739e8fbaf8c4a78d0
Added by Mirco Bauer 3459 days ago

configure.ac: bumped minimum required Mono version to 2.8 (refs: #1058)

Mono 2.6.7 incorrectly de-serializes DateTime values sent over .NET remoting.
Smuxi frontends sending DateTime values to a smuxi-server that runs on Mono
2.6.7 will end up with a value that is off by the timezone offset. E.g.:
2015-06-12T20:03:34.7553410Z on the frontend becomes
2015-06-12T18:03:34.7553410Z on the server side if the timezone offset is +2

This change is needed to really fix bff11a093e0e57184a54ee0860aa586036dd2746
as with Mono 2.6.7 as smuxi-server still had the bug seen in #1058.

Revision 4cdc94d5b294f1df31b35f8344f5ca362e041cf4
Added by Mirco Bauer 3457 days ago

Common: de-serialize DateTime ticks in UTC (refs: #1058)

DateTime ticks are by definition from a specified point of time in UTC [0]. The
DateTime ctor that takes tick as Int64 initializes the DateTime object though as
DateTimeKind.Unspecified leading to unexpected behavior when the time is
transformed to UTC or local time.

https://msdn.microsoft.com/en-us/library/system.datetime.ticks(v=vs.110).aspx

History

Updated by Felipe Sateler 3483 days ago

avatar

Updated by Mirco Bauer 3481 days ago

avatar
  • Status changed from New to Feedback

Do you run different timezones between server and frontend and can you produce this issue? I can't reproduce it.

Updated by Mirco Bauer 3467 days ago

avatar

I think this is the same issue as #1064 with just a different symptom but same cause which I have fixed. Can you see if you can reproduce it with smuxi-engine being 5d192fe ?

Updated by Mirco Bauer 3462 days ago

avatar
  • Subject changed from Unseen message marks seen as unseen on reconnect to server to Seen message become unseen on reconnect to server

Updated by Mirco Bauer 3462 days ago

avatar

There is a bug in the way datetime values are stored in the SQLite DB. There is a 4 hours offset (UTC compared to local time) while it should be 2 for me. So I believe this is a .NET remoting serialization issue with Mono 2.6.7 <-> 3.2.8, not sure about other versions yet.

sqlite> select * from Properties;
LastSeenHighlight|2015-06-12T04:09:15.6688680Z
LastSeenMessage|2015-06-12T04:09:15.6688680Z
                           ^^^^^

That should read 06:09. As my local frontend time is 08:09 and the smuxi-server also runs on 08:09 local time.

Updated by Mirco Bauer 3461 days ago

avatar
  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

Updated by Mirco Bauer 3457 days ago

avatar
  • Complexity changed from Low to High

This was a really nasty bug...

Also available in: Atom PDF