Project

General

Profile

Retrieve a list of archived message with "after" set to incorrect value

Łukasz Soszyński
Added almost 5 years ago

I observed very minor issue. When I retrieve a list of archived messages with "after" set to incorrect value then server doesn't return response.

Example request (incorrect string: 2014-04-02T15:58:36+0000):

<iq from="000000000101@localhost/localhost" xmlns="jabber:client" id="cccc" type="get">
                <list xmlns="urn:xmpp:archive" start="1990-01-01T00:00:00.001+0000">
                                <set xmlns="http://jabber.org/protocol/rsm">
                                                <max>2</max>

                                        <after>2014-04-02T15:58:36+0000</after>

        </set>

    </list>

In Tigase log I can see stacktrace:

java.lang.NumberFormatException: For input string: "2014-04-02T15:58:36+0000"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:492)
        at java.lang.Integer.parseInt(Integer.java:527)
        at tigase.archive.MessageArchiveDB.getCollections(MessageArchiveDB.java:485)
        at tigase.archive.MessageArchiveComponent.listCollections(MessageArchiveComponent.java:264)
        at tigase.archive.MessageArchiveComponent.processActionPacket(MessageArchiveComponent.java:214)
        at tigase.archive.MessageArchiveComponent.processPacket(MessageArchiveComponent.java:107)
        at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1475)

I want server to always return an XMPP “item-not-found” error to the caller (or an application-specific XMPP error ) if a selector value does not have the expected format