Projects tigase _server server-core Issues #445
Offline message received whenever I login. (#445)
Closed
Azeem Akram opened 10 years ago
Due Date
2015-03-23

Hello Team,

Thanks for your help in advance.

I am having an issue in receiving offline messages. Please review the steps below to understand the issue.

  1. User_1 and User_2 are online and send messages to each other. Messages are being delivered accurately and in time.

  2. User_1 suddenly goes offline, but User_2 keeps sending messages to User_1.

  3. Those messages are stored somewhere on server as "Offline Stored Messages" to be sent later.

  4. Now after some time User_1 comes online again, and receive the offline message sent by User_2 immediately.

  5. User_1 goes offline again after reading the received offline messages from User_2.

  6. Next day, User_1 comes online again and again receives the offline message sent by User_2 previous day, (which he has already received and read - as per point number 4)

  7. This happens with every login, Every time User_1 come online, first it receives all the offline message sent by any friend at any time.

  8. It looks like, Offline Stored Messages status never updated even after they are delivered.

  9. Any new Offline Message intends the receiver to receive the complete list of offline message sent in the past and received too.

What can I think to resolve it,

  1. Either, we need a way to update the status of the message to be "read" from "Unread"

  2. We can delete the Offline Message that we have received.

I am anxiously looking forward to get this issue resolved as soon as possible as my BIG project is stuck on this issue.

Best Regards

Azeem Akram

Simon Tennant commented 10 years ago

@tigase team: Let me know what other info you need to be able to debug this issue.

Daniele Ricci commented 10 years ago

I can confirm this happens to me too, but I'm currently unable to provide logs. Specifically, Tigase re-saves the message appending more and more elements to it. I'll try to "frame the moment" and get back to you.

Daniele Ricci commented 10 years ago

Ok I think I know what is causing this (or a similar bug maybe?). Steps to reproduce:

  1. bob@server.org/work sends a message to alice@server.og/home which is offline (goes to offline storage)

  2. alice@server.org connects with another resource

  3. alice@server.org/newresource gets the message from bob, but receiving it with to="alice@server.org" (bare JID)

  4. the message is probably also queued with the origin full JID, because it gets stored to offline storage again

  5. message is delivered to "newresource" everytime and stored again until the old resource ("home") gets back

I suggest that a message delivered to an offline full JID either:

  • is stored to offline storage with the bare JID

  • is delivered only to the intended bare JID

Artur Hefczyc commented 10 years ago

Andrzej, please take a look at it as soon as you can.

Andrzej Wójcik (Tigase) commented 10 years ago

I tried to replicate this issue using newst version from master branch, but I was not able to replicate this issue.

Message was sent to offline store only once and when it was retrieved to deliver to user it was removed from offline storage.

I would suggest to check logs for any possible exceptions which may be related to this issue as this may give us some hints about cause of this issue (ie. permissions to database tables might not allow Tigase to remove records).

Another reason for this might be that XMPP client which receives message once it connects is using XEP-0198 Stream Management and is not acking that it received this message - this would lead to sending this message to offline store once again - but behavior of Tigase XMPP Server would be correct in this case as Stream Managements needs to send messages which are not acked to offline storage.

Other reason could be some custom code which could create a loop.

To continue this investigation I would need:

  • to know whether it was in clustered environment or in single instance (if in cluster mode then how many cluster nodes where connected)

  • copy of Tigase XMPP Server configuration file etc/init.properties so I could check what is enabled and how it should work in this case.

  • logs with entries from time when this occured issue occurred

Andrzej Wójcik (Tigase) commented 10 years ago

Also I would like to know what was load on server on which this occurred? Was it rather big or on this server there was a lot of presence packets to process at the time when this issue occurred.

I think that this may be caused by patch from #2561 if it was applied, was it?

Daniele Ricci commented 10 years ago

Hi, I'll upgrade to latest version and try reproduce it myself. For now I've solved the most important issue which causes the delay element to be added over and over by using a workaround:

https://github.com/kontalk/tigase-server/blob/master/src/main/java/tigase/xmpp/impl/OfflineMessages.java#L296

Don't care about the wrong comment; what I did here is check if the delay element was already added and, if not, add it.

Artur Hefczyc commented 9 years ago

Closing as there was no feedback, so I assume the problem was not replicated.

issue 1 of 1
Type
Bug
Priority
Major
Assignee
RedmineID
2855
Version
tigase-server-7.1.0
Spent time
6h
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#445
Please wait...
Page is in error, reload to recover