Project

General

Profile

Received list of archived messages is sorted lexicographically by seconds string - time when message was sent.

Łukasz Soszyński
Added almost 5 years ago

Lets assume I want to download given number of archived messages from XMPP server. Tigase returns list of messages where each message has "secs" attribute. This attribute contains as a value number of seconds form some common point in time and says when message was sent.

Lets assume I want to download 2 messages since time specified as "start" parameter:

<iq id='ala7' type='get'>
        <retrieve xmlns='urn:xmpp:archive' start='2014-03-13T08:56:06.000+0000' with='000000000115@localhost'>
                <set xmlns='http://jabber.org/protocol/rsm'>
                        <max>2</max>
                </set>
        </retrieve>
</iq>

Server responses:

<iq xmlns='jabber:client' type='result' id='ala7' to='000000000112@localhost/Mac-mini-waw-mini1'>
        <chat xmlns='urn:xmpp:archive' with='000000000115@localhost' start='2014-03-13T08:56:06+0000'>
                <to secs='0'>
                        <body>hi</body>
                </to>
                <to secs='5'>
                        <body>jol</body>
                </to>
                <set xmlns='http://jabber.org/protocol/rsm'>
                        <first index='0'>0</first>
                        <last>5</last>
                        <count>31</count>
                </set>
        </chat>
</iq>

Two above messages are the oldest one saved in Tigase database.

Now I request Tigase for 3 oldest messages:

<iq id='ala7' type='get'>
        <retrieve xmlns='urn:xmpp:archive' start='2014-03-13T08:56:06.000+0000' with='000000000115@localhost'>
                <set xmlns='http://jabber.org/protocol/rsm'>
                        <max>3</max>
                </set>
        </retrieve>
</iq>

Tigase response:

<iq xmlns='jabber:client' type='result' id='ala7' to='000000000112@localhost/Mac-mini-waw-mini1'>
        <chat xmlns='urn:xmpp:archive' with='000000000115@localhost' start='2014-03-13T08:56:06+0000'>
                <to secs='0'>
                        <body>hi</body>
                </to>
                <to secs='435'>
                        <body>yo</body>
                </to>
                <to secs='5'>
                        <body>jol</body>
                </to>
                <set xmlns='http://jabber.org/protocol/rsm'>
                        <first index='0'>0</first>
                        <last>5</last>
                        <count>31</count>
                </set>
        </chat>
</iq>

As you can see the above response contains three oldest messages, sorted in inappropriate way.

The desired order is:

<iq xmlns='jabber:client' type='result' id='ala7' to='000000000112@localhost/Mac-mini-waw-mini1'>
        <chat xmlns='urn:xmpp:archive' with='000000000115@localhost' start='2014-03-13T08:56:06+0000'>
                <to secs='0'>
                        <body>hi</body>
                </to>
                <to secs='5'>
                        <body>jol</body>
                </to>
                <to secs='435'>
                        <body>yo</body>
                </to>
                <set xmlns='http://jabber.org/protocol/rsm'>
                        <first index='0'>0</first>
                        <last>5</last>
                        <count>31</count>
                </set>
        </chat>
</iq>

Do we have to sort messages on client side?


Replies (8)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam almost 5 years ago

Could you tell me which version of Tigase Message Archiving are you using?

I suppose that last stable release had this issue. Current version in repository should not have this issue. Could you check if this issue still appears if you are using SNAPSHOT version of Tigase Message Archiving?

Added by Łukasz Soszyński almost 5 years ago

Yes, I'm using last stable release (5.2.0). From my point of view it is very hard to test snapshot version. That is why I have to wait for new beta version :( Has the release date been already planned?

Added by Wojciech Kapcia TigaseTeam almost 5 years ago

Is there something partucilar wrong with snapshots/nightlies? You have exactly the same set of files that come as beta (i.e. archives as well as installer packages).

Added by Łukasz Soszyński almost 5 years ago

We use configuration management tool for application deployment automation. Our scripts uses file tigase-server-5.2.0-b3447-dist-max.zip. Thanks to this we are able to update Tigase Server version on all our environment in automatic way.

Added by Wojciech Kapcia TigaseTeam almost 5 years ago

If the issue is only changing source file name then it should be relatively easily to test nightlies as they follow exactly same procedure as final/beta releases, e.g. tigase-server-5.3.0-SNAPSHOT-b3486-dist-max.zip

Added by Łukasz Soszyński almost 5 years ago

Ok, it is fine :)

Added by Łukasz Soszyński almost 5 years ago

Hi,

I check this on version 5.3.0-SNAPSHOT b3491 2014-04-01

REQUEST:

<iq id='ala7' type='get'>
    <retrieve xmlns='urn:xmpp:archive' start='2014-03-31T12:38:55.000+0000' with='000000000131@localhost'>
        <set xmlns='http://jabber.org/protocol/rsm'>
            <max>8</max>
        </set>
    </retrieve>
</iq>

RESPONSE:

<iq type='result' id='ala7' to='000000000101@localhost/localhost'>
    <chat xmlns='urn:xmpp:archive' with='000000000131@localhost' start='2014-03-31T12:38:55+0000'>
        <to secs='0'>
            <body>3</body>
        </to>
        <to secs='0'>
            <body>2</body>
        </to>
        <to secs='1'>
            <body>42</body>
        </to>
        <to secs='1'>
            <body>42</body>
        </to>
        <from secs='158'>
            <body>fdsdf</body>
        </from>
        <to secs='2'>
            <body>4</body>
        </to>
        <to secs='2'>
            <body>2</body>
        </to>
        <to secs='2'>
            <body>42</body>
        </to>
        <set xmlns='http://jabber.org/protocol/rsm'>
            <first index='0'>0</first>
            <last>2</last>
            <count>38</count>
        </set>
    </chat>
</iq>

Received list of archived messages is sorted lexicographically by seconds string - time when message was sent.

Added by Łukasz Soszyński almost 5 years ago

After upgrade in proper way everything works OK :) Thanks

    (1-8/8)