Project

General

Profile

Same archived message in two chats with different times, time of first is 1s before second

Łukasz Soszyński
Added over 4 years ago

When I want to retrieve chats after last retrieved message of a chat (which is newest message),

then I receive same message which was received as last in previous chat and this message

has different time by one second then in previous chat.

Example:

First request and response:

<iq id='aaa8' type='get'>
  <retrieve xmlns='urn:xmpp:archive' start='2014-04-25T13:16:57+0000' with='000000000112@localhost'>
    <set xmlns='http://jabber.org/protocol/rsm'>
    <max>100</max>
    </set>
  </retrieve>
</iq>

<iq xmlns='jabber:client' to='000000000115@localhost/WAW-MINI3s-Mac-mini' type='result' id='aaa8'>
        <chat xmlns='urn:xmpp:archive' with='000000000112@localhost' start='2014-04-25T13:16:57+0000'>
                <from secs='0'>
                        <body>roy</body>
                </from>
                <set xmlns='http://jabber.org/protocol/rsm'>
                        <first index='0'>0</first>
                        <last>0</last>
                        <count>1</count>
                </set>
        </chat>
</iq>

Second request and response:

<iq id='aaa8' type='get'>
  <retrieve xmlns='urn:xmpp:archive' start='2014-04-25T13:16:58+0000' with='000000000112@localhost'>
    <set xmlns='http://jabber.org/protocol/rsm'>
    <max>100</max>
    </set>
  </retrieve>
</iq>

<iq xmlns='jabber:client' to='000000000115@localhost/WAW-MINI3s-Mac-mini' type='result' id='aaa8'>
        <chat xmlns='urn:xmpp:archive' with='000000000112@localhost' start='2014-04-25T13:16:58+0000'>
                <from secs='0'>
                        <body>roy</body>
                </from>
                <set xmlns='http://jabber.org/protocol/rsm'>
                        <first index='0'>0</first>
                        <last>0</last>
                        <count>1</count>
                </set>
        </chat>
</iq>

In this example one chat starts from 2014-04-25T13:16:57+0000 and second starts with 2014-04-25T13:16:58+0000 and both contain same message. And both have same time difference from start point, which is 0 in both cases.

Another example:

<iq id='aaa2' type='get'>
  <retrieve xmlns='urn:xmpp:archive' start='2014-04-25T12:39:32+0000' with='000000000112@localhost'>
    <set xmlns='http://jabber.org/protocol/rsm'>
    <max>100</max>
    </set>
  </retrieve>
</iq>

<iq xmlns='jabber:client' to='000000000115@localhost/WAW-MINI3s-Mac-mini' type='result' id='aaa2'>
        <chat xmlns='urn:xmpp:archive' with='000000000112@localhost' start='2014-04-25T12:39:32+0000'>
                <from secs='0'>
                        <body>hej</body>
                </from>
                <to secs='242'>
                        <active xmlns='http://jabber.org/protocol/chatstates'/>
                        <body>new yo</body>
                </to>
                <from secs='440'>
                        <body>hi 2</body>
                </from>
                <to secs='569'>
                        <active xmlns='http://jabber.org/protocol/chatstates'/>
                        <body>new yo 2</body>
                </to>
                <from secs='1018'>
                        <body>hi3</body>
                </from>
                <to secs='1935'>
                        <active xmlns='http://jabber.org/protocol/chatstates'/>
                        <body>yo 3</body>
                </to>
                <to secs='1937'>
                        <active xmlns='http://jabber.org/protocol/chatstates'/>
                        <body>y 4</body>
                </to>
                <to secs='1940'>
                        <active xmlns='http://jabber.org/protocol/chatstates'/>
                        <body>y 5</body>
                </to>
                <from secs='2201'>
                        <body>yo 1</body>
                </from>
                <from secs='2209'>
                        <body>yoy</body>
                </from>
                <from secs='2239'>
                        <body>yot</body>
                </from>
                <from secs='2245'>
                        <body>roy</body>
                </from>
                <set xmlns='http://jabber.org/protocol/rsm'>
                        <first index='0'>0</first>
                        <last>11</last>
                        <count>12</count>
                </set>
        </chat>
</iq>

Time of receiving last message in the above chat is 2014-04-25T12:39:32+0000 + 2245 = 2014-04-25T13:16:57+0000

Downloading chats after last message:

<iq id='aaa11' type='get'>
  <list xmlns='urn:xmpp:archive' start='2014-04-25T13:16:57+0000'>
    <set xmlns='http://jabber.org/protocol/rsm'>
    <max>50</max>
    </set>
  </list>
</iq>

<iq xmlns='jabber:client' to='000000000115@localhost/WAW-MINI3s-Mac-mini' type='result' id='aaa11'>
        <list xmlns='urn:xmpp:archive'>
                <chat with='000000000112@localhost' start='2014-04-25T13:16:58+0000'/>
                <set xmlns='http://jabber.org/protocol/rsm'>
                        <first index='0'>0</first>
                        <last>0</last>
                        <count>1</count>
                </set>
        </list>
</iq>

Why chat date after last message is 2014-04-25T13:16:58+0000 it should be 2014-04-25T13:16:57+0000

Time of last message computed from previous chat is 2014-04-25T13:16:57+0000 but according to this chat it is 2014-04-25T13:16:58+0000.


Replies (2)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 4 years ago

I just checked this on two diffrent instances and I was not able to replicate your results. In my tests I always received result I expected, but I suppose there may be an issue related to handling miliseconds of a message as in examples you posted I see that there is always difference not bigger than 1 second. I was checking using MySQL version 5.1.62-0ubuntu0.11.10.1-log as a database backend, which database server and version you are using?

Added by Łukasz Soszyński over 4 years ago

I use newer database version: Mysql 5.6.10-1 installed on CentOS.

    (1-2/2)