Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The message sent to yourself is stored twice in user's MAM. #3294

Closed
DenysGonchar opened this issue Sep 23, 2021 · 1 comment
Closed

The message sent to yourself is stored twice in user's MAM. #3294

DenysGonchar opened this issue Sep 23, 2021 · 1 comment

Comments

@DenysGonchar
Copy link
Collaborator

DenysGonchar commented Sep 23, 2021

MongooseIM version: 4.1
Installed from: -
Erlang/OTP version: Erlang/OTP 21 [erts-10.3.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]

The message sent to yourself is stored twice in user's MAM.
This issue is originally reported in a comment here
here are the logs:

SEND:
   <message xmlns="jabber:client" from="1145@localhost/test1616185534147" id="8bf685ae-4743-46fe-94ae-35ac13a4b467" to="1145@localhost" type="chat">
      <body>1ZZZZZZZZZZZZZZZZZZ</body>
      <origin-id xmlns="urn:xmpp:sid:0" id="8bf685ae-4743-46fe-94ae-35ac13a4b467" />
   </message>
RECV:
   <message xmlns="jabber:client" from="1145@localhost/test1616185534147" id="8bf685ae-4743-46fe-94ae-35ac13a4b467" to="1145@localhost" type="chat" xml:lang="en">
      <body>1ZZZZZZZZZZZZZZZZZZ</body>
      <origin-id xmlns="urn:xmpp:sid:0" id="8bf685ae-4743-46fe-94ae-35ac13a4b467" />
      <stanza-id xmlns="urn:xmpp:sid:0" by="1145@localhost" id="BFF9GBD7OBG1" />
   </message>
SEND:
   <iq xmlns="jabber:client" id="b1a13a82-5084-4a37-89ae-26395ceb3968:sendIQ" type="set">
      <query xmlns="urn:xmpp:mam:2">
         <x xmlns="jabber:x:data" type="submit">
            <field type="hidden" var="FORM_TYPE">
               <value>urn:xmpp:mam:2</value>
            </field>
            <field var="with">
               <value>1145@localhost</value>
            </field>
         </x>
         <set xmlns="http://jabber.org/protocol/rsm">
            <max>2</max>
            <before />
         </set>
      </query>
   </iq>
RECV:
   <message xmlns="jabber:client" from="1145@localhost" id="9c1c0409-d5e0-4b5b-bbc3-dcbf0521655a" to="1145@localhost/test1616185759389">
      <result xmlns="urn:xmpp:mam:2" id="BFF9GBD6TP01">
         <forwarded xmlns="urn:xmpp:forward:0">
            <delay xmlns="urn:xmpp:delay" from="1145@localhost/test1616185534147" stamp="2021-03-19T20:25:03Z" />
            <message xmlns="jabber:client" from="1145@localhost/test1616185534147" id="8bf685ae-4743-46fe-94ae-35ac13a4b467" to="1145@localhost" type="chat" xml:lang="en">
               <body>1ZZZZZZZZZZZZZZZZZZ</body>
               <origin-id xmlns="urn:xmpp:sid:0" id="8bf685ae-4743-46fe-94ae-35ac13a4b467" />
            </message>
         </forwarded>
      </result>
   </message>
   <message xmlns="jabber:client" from="1145@localhost" id="01a93468-77ac-4c5e-b67e-d22b0f52e93e" to="1145@localhost/test1616185759389">
      <result xmlns="urn:xmpp:mam:2" id="BFF9GBD7OBG1">
         <forwarded xmlns="urn:xmpp:forward:0">
            <delay xmlns="urn:xmpp:delay" from="1145@localhost/test1616185534147" stamp="2021-03-19T20:25:03Z" />
            <message xmlns="jabber:client" from="1145@localhost/test1616185534147" id="8bf685ae-4743-46fe-94ae-35ac13a4b467" to="1145@localhost" type="chat" xml:lang="en">
               <body>1ZZZZZZZZZZZZZZZZZZ</body>
               <origin-id xmlns="urn:xmpp:sid:0" id="8bf685ae-4743-46fe-94ae-35ac13a4b467" />
            </message>
         </forwarded>
      </result>
   </message>
   <iq xmlns="jabber:client" from="1145@localhost" id="b1a13a82-5084-4a37-89ae-26395ceb3968:sendIQ" to="1145@localhost/test1616185759389" type="result">
      <fin xmlns="urn:xmpp:mam:2">
         <set xmlns="http://jabber.org/protocol/rsm">
            <first index="161">BFF9GBD6TP01</first>
            <last>BFF9GBD7OBG1</last>
            <count>163</count>
         </set>
      </fin>
   </iq>

The reason why it happens - the message is written independently into sender's and receiver's archives (notice that returned 2 messages have different MAM ID's: BFF9GBD7OBG1 and BFF9GBD6TP01). It's expected behavior, but we probably should change it and avoid this duplication. Because sending message to yourself is quite popular solution for making notes in most of the modern messengers.

@DenysGonchar
Copy link
Collaborator Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants