#624 SQL storage: Non-existent archive ID should be treated as beyond the start or end of archive
Reporter
Sebseb01
Owner
Zash
Created
Updated
Stars
★ (1)
Tags
Status-Fixed
Milestone-0.10
Component-Persistence
Type-Defect
Priority-Medium
Sebseb01
on
Recently, i just note my MAM is not working with my Client (Gajim).
If my client request mam history with an invalid (too old ?) UID
Server respond just a count but no result !
I have just delete UID from memory of my client (last_mam_id), and no i receive all my history !
Like you can see below (All XML contain mam in session (except #disco))
-------------------------------------
<iq xmlns="jabber:client" type="set" id="503">
<query xmlns="urn:xmpp:mam:0" queryid="502">
<x xmlns="jabber:x:data" type="submit">
<field var="FORM_TYPE" type="hidden">
<value>urn:xmpp:mam:0</value>
</field>
</x>
<set xmlns="http://jabber.org/protocol/rsm">
<max>30</max>
<after>761e2536-66d5-4889-8620-e65290ce0691</after>
</set>
</query>
</iq>
****
<iq id='503' type='result' to='sebseb01@server/ressource'/>
<message to='sebseb01@server/ressource'>
<fin complete='true' queryid='502' xmlns='urn:xmpp:mam:0'>
<set xmlns='http://jabber.org/protocol/rsm'>
<count>777</count>
</set>
</fin>
</message>
-----------
Server should not respond https://xmpp.org/extensions/xep-0059.html#notfound ? (and client retry without UID ?)
Thanks
Zash
on
Hi, thanks for the report!
Could you provide some details of your setup, what exact version of prosody, what storage backend you are using and, if SQL, which database backend?
Just for the record: if the UID is not in the archive, the server should send the full archive to the client (unless some other filtering criteria is present).
That response is weird (count but no results).
Zash
on
Looks like the current SQL does not behave as intended. Comparing to the result of the subquery that is meant to find the internal id of the 'after' message does not work (at least with SQLite3).
Related: mod_storage_xmlarchive has a similar issue because it has no way to know if a message with a specific id exists without doing a linear search over a days worth of messages.
Zash
on
This is a problem with mod_storage_sql, not mod_mam, changing title.
Changes
title[mod_mam] don't get error if i request an invalid uid SQL storage: Non-existent archive ID should be treated as beyond the start or end of archive
Recently, i just note my MAM is not working with my Client (Gajim). If my client request mam history with an invalid (too old ?) UID Server respond just a count but no result ! I have just delete UID from memory of my client (last_mam_id), and no i receive all my history ! Like you can see below (All XML contain mam in session (except #disco)) ------------------------------------- <iq xmlns="jabber:client" type="set" id="503"> <query xmlns="urn:xmpp:mam:0" queryid="502"> <x xmlns="jabber:x:data" type="submit"> <field var="FORM_TYPE" type="hidden"> <value>urn:xmpp:mam:0</value> </field> </x> <set xmlns="http://jabber.org/protocol/rsm"> <max>30</max> <after>761e2536-66d5-4889-8620-e65290ce0691</after> </set> </query> </iq> **** <iq id='503' type='result' to='sebseb01@server/ressource'/> <message to='sebseb01@server/ressource'> <fin complete='true' queryid='502' xmlns='urn:xmpp:mam:0'> <set xmlns='http://jabber.org/protocol/rsm'> <count>777</count> </set> </fin> </message> ----------- Server should not respond https://xmpp.org/extensions/xep-0059.html#notfound ? (and client retry without UID ?) Thanks
Hi, thanks for the report! Could you provide some details of your setup, what exact version of prosody, what storage backend you are using and, if SQL, which database backend?
ChangesProsody 0.10 nightly build 202 (2016-01-22, 5286e79c6829) # Lua environment Lua version: Lua 5.1 Backend SQL / SQLite3 Thanks !!!
Just for the record: if the UID is not in the archive, the server should send the full archive to the client (unless some other filtering criteria is present). That response is weird (count but no results).
Looks like the current SQL does not behave as intended. Comparing to the result of the subquery that is meant to find the internal id of the 'after' message does not work (at least with SQLite3). Related: mod_storage_xmlarchive has a similar issue because it has no way to know if a message with a specific id exists without doing a linear search over a days worth of messages.
This is a problem with mod_storage_sql, not mod_mam, changing title.
Changes[mod_mam] don't get error if i request an invalid uidSQL storage: Non-existent archive ID should be treated as beyond the start or end of archiveFixed (I hope) in http://hg.prosody.im/0.10/rev/5953f415c815 Please test
Changes