#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
  1. 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

  2. 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?

    Changes
    • owner Zash
    • tags Status-Accepted
  3. Sebseb01 on

    Prosody 0.10 nightly build 202 (2016-01-22, 5286e79c6829) # Lua environment Lua version: Lua 5.1 Backend SQL / SQLite3 Thanks !!!

  4. MattJ on

    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).

  5. 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.

  6. 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
    • tags Component-Persistence Milestone-0.10
  7. Zash on

    Fixed (I hope) in http://hg.prosody.im/0.10/rev/5953f415c815 Please test

    Changes
    • tags Status-Fixed

New comment

Not published. Used for spam prevention and optional update notifications.