Project

General

Profile

Message Archiving Archives Incoming Message with AMP Twice

William Lee
Added about 2 years ago

Hey there,

Currently, we're having an issue with Message Archiving and AMP. The issue is that when we send a message with AMP, the incoming message is archived twice. We believe this is due to the AMP plugin since this only happens when we have the AMP path in the message. Also, we tried disabling the AMP plugin in the init.properties and it only archived once for each direction (which is the behaviour we want). Do you have any ideas on how to correctly modify this message archiving behaviour to what we want?

Thanks.


Replies (6)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam about 2 years ago

I think you are trying to do the same thing which was already discussed in AMP + Message Archiving

Added by William Lee about 2 years ago

I believe it's a different case. That post is seeing 3 entries in the message-archiving database. Two of them is the the message itself (outgoing and incoming) and the third is the AMP response from the server. In our case, we have 3 entries as well and two of them is the same (the outgoing and incoming) but our third entry is different. Our third entry is actually the incoming message that's been archived twice. It's the exact same stanza except with a different timestamp.

An example of the three entries:

@11410 26 18 2017-03-03 03:12:33.747 1 chat Sunt saepe et numquam tenetur modi ut illum.这यहこน이Эéç Sunt saepe et numquam tenetur modi ut illum.这यहこน이Эéç 4/fvliS/Fh6BnrXLMGwjhkP/cpE/f0OVdIgQme1/yM8= Smack

11409 26 18 2017-03-03 03:12:33.743 1 chat Sunt saepe et numquam tenetur modi ut illum.这यहこน이Эéç Sunt saepe et numquam tenetur modi ut illum.这यहこน이Эéç 4/fvliS/Fh6BnrXLMGwjhkP/cpE/f0OVdIgQme1/yM8= Smack

11408 18 26 2017-03-03 03:12:33.743 0 chat Sunt saepe et numquam tenetur modi ut illum.这यहこน이Эéç Sunt saepe et numquam tenetur modi ut illum.这यहこน이Эéç EwM+Io5oklbC9WD0MglR02uiae8U3N+0zrPmKoTJyKo=@

As you can see, the first entry (the bottom as this was sorted in desc order) is the outoging message. The second and third entry is the exact same except the timestamp.

Added by William Lee about 2 years ago

To ad onto this, when I debugged the MessageAmp class, I found that the packet was being processed twice. Is this the expected behaviour? I was assuming each message would only be processed once.

Example of the two packets being processed:

@

from=bosh@williamle-mbp.orion.internal/69dc02a7-2c98-410a-a138-0b0973e42757, to=sess-man@williamle-mbp.orion.internal, DATA=

 <body>Hello 013</body>

 <request xmlns="urn:xmpp:receipts"/>

 <amp xmlns="http://jabber.org/protocol/amp">

    <rule action="notify" condition="deliver" value="direct"/>

    <rule action="notify" condition="deliver" value="stored"/>

    <rule action="error" condition="deliver" value="none"/>

 </amp>

</message>, SIZE=509, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=chat

@

@

from=null, to=sess-man@williamle-mbp.orion.internal, DATA=<message xmlns="jabber:client" id="5b478c00-92e3-4b6c-9036-9c5809ed5946" from="testbot1@example.com/1661749366-tigase-1" type="chat" to="john.cardinal@example.com">

 <body>Hello 013</body>

 <request xmlns="urn:xmpp:receipts"/>

 <amp xmlns="http://jabber.org/protocol/amp">

    <rule action="notify" condition="deliver" value="direct"/>

    <rule action="notify" condition="deliver" value="stored"/>

    <rule action="error" condition="deliver" value="none"/>

 </amp>

</message>, SIZE=509, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=chat

@

The only difference between these two is that the second one has a null 'from' at the beginning.

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam about 2 years ago

Let's start with message being processed twice by AMP. As you wrote:

I was assuming each message would only be processed once.

it is true, but it will be processed once for each users session. So it is processed once when it is being sent by sender and second time while it is being received by message recipient.

Real issue is with this two entries:

11410 26 18 2017-03-03 03:12:33.747 1 chat Sunt saepe et numquam tenetur modi ut illum.这यहこน이Эéç Sunt saepe et numquam tenetur modi ut illum.这यहこน이Эéç 4/fvliS/Fh6BnrXLMGwjhkP/cpE/f0OVdIgQme1/yM8= Smack

11409 26 18 2017-03-03 03:12:33.743 1 chat Sunt saepe et numquam tenetur modi ut illum.这यहこน이Эéç Sunt saepe et numquam tenetur modi ut illum.这यहこน이Эéç 4/fvliS/Fh6BnrXLMGwjhkP/cpE/f0OVdIgQme1/yM8= Smack

Please tell me which version of Tigase XMPP Server do you use and with which database is used as a backend for Message Archiving component. This will allow me to verify code responsible for avoiding duplication of messages.

Added by William Lee about 2 years ago

Currently we're using the 7.1.0 release of Tigase Server and 1.2 of Message Archiving and the database which the message archiving table sits in is a Microsoft SQL database.

Added by Mauricio Giacomello about 2 years ago

I'm quite interested in this thread. Any updates from any side?

    (1-6/6)