Skip to content

ejabberd return two stanza-id for the last message when requesting from MAM #4544

@edhelas

Description

@edhelas

On ejabberd version: 25.10

Movim had some duplicated messages in the chatrooms, I found out that ejabberd was returning two stanza-id when retrieving the last one.

The second one is actually the correct one.

<iq to='c80fc9ea-3e05-4e0d-8b47-fcfe407b6909@conference.movim.eu' type='set' id='c4nieWY54ZFm' lang='en'>
	<query xmlns='urn:xmpp:mam:2' queryid='uefMnlO3MbUg'>
		<x xmlns='jabber:x:data' type='submit'>
			<field var='FORM_TYPE'>
				<value>urn:xmpp:mam:2</value>
			</field>
			<field var='start'>
				<value>2026-03-10T19:44:34Z</value>
			</field>
		</x>
		<set xmlns='http://jabber.org/protocol/rsm'>
			<max>500</max>
		</set>
	</query>
</iq>
<message to='miho@movim.eu/1668228128736413482168318179' from='c80fc9ea-3e05-4e0d-8b47-fcfe407b6909@conference.movim.eu'>
	<result xmlns='urn:xmpp:mam:2' id='1773171874601846' queryid='uefMnlO3MbUg'>
		<forwarded xmlns='urn:xmpp:forward:0'>
			<message lang='en' from='c80fc9ea-3e05-4e0d-8b47-fcfe407b6909@conference.movim.eu/Miho' type='groupchat' id='671499e0-4562-4a56-83c7-eafbcd35d804'>
				<archived xmlns='urn:xmpp:mam:tmp' by='c80fc9ea-3e05-4e0d-8b47-fcfe407b6909@conference.movim.eu' id='1773171874601846'/>
				<stanza-id xmlns='urn:xmpp:sid:0' by='c80fc9ea-3e05-4e0d-8b47-fcfe407b6909@conference.movim.eu' id='1773171874601846'/>
				<active xmlns='http://jabber.org/protocol/chatstates'/>
				<markable xmlns='urn:xmpp:chat-markers:0'/>
				<origin-id xmlns='urn:xmpp:sid:0' id='671499e0-4562-4a56-83c7-eafbcd35d804'/>
				<occupant-id xmlns='urn:xmpp:occupant-id:0' id='g20AAAAgexp4mKdYydvf/tJ0Zho7U6Apyq7YYMnblAY+0mI9pbs='/>
				<stanza-id xmlns='urn:xmpp:sid:0' by='c80fc9ea-3e05-4e0d-8b47-fcfe407b6909@conference.movim.eu' id='1773171874601708'/>
				<addresses xmlns='http://jabber.org/protocol/address'>
					<address jid='miho@movim.eu/Movim.AyoXIw.Onopt1FWrN' type='ofrom'/>
				</addresses>
				<delay xmlns='urn:xmpp:delay' from='c80fc9ea-3e05-4e0d-8b47-fcfe407b6909@conference.movim.eu' stamp='2026-03-10T19:44:34.601846Z'/>
				<body>😁 😁 😁 </body>
			</message>
			<delay xmlns='urn:xmpp:delay' from='conference.movim.eu' stamp='2026-03-10T19:44:34.601846Z'/>
		</forwarded>
	</result>
</message>

The <result id=''/> is also not the correct one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions