[Standards] XEP-0136: relative vs absolute time in from/to elements

Alexander Tsvyashchenko lists at ndl.kiev.ua
Sat Aug 21 12:53:48 UTC 2010

Hello All,

Thanks to author of Vacuum IM (http://www.vacuum-im.org/) I became aware
of serious difference in behavior between my XEP-136 server implementations
(mod_archive_odbc and mod_archive2) and described in XEP-136 standard,
namely item 4.6, interpretation of seconds in from/to elements.

When I implemented mod_archive_odbc, this paragraph was not yet there, so
I just assumed these seconds specify absolute time between the start of
conversation and current message. However, later (0.16 revision?) the text
was changed to clarify that these seconds are relative to previous message,
but I've not noticed it when re-reading spec after that as I didn't expect
to find this change in quite basic part of the specification.

I believe this change was wrong decision due to a number of reasons:

* It complicates server implementation: whether server design calculates
relative times on messages storage (so it stores seconds) or retrieval (so
it stores absolute times and converts them to seconds on retrieval), it
needs to remember previous message time to be able to calculate relative
time. Additionally, in "calculation on retrieval" design, the design is
more complex due to two possible directions of traversing the messages (due
to RSM "before" element).

* More importantly, it becomes harder (or even impossible in some
scenarios) on the client side to page through messages: if client needs to
retrieve messages 1000 to 1100, it will have to retrieve messages 0 to 1000
first just to be able to show correct times for 1000 to 1100 messages.

* In general, if client needs to have relative time between messages and
has absolute times available - it's trivial to calculate relative time
having previous and current message. On the other hand, in the opposite
case (when only relative time exists) calculating absolute time is hard
(see above) - that's why I think specification should be based on more
"generic" case (working with "absolute" times) which enables more scenarios
rather than one (working with "relative" times) that might be suitable for
one concrete case (when absolute times for messages are not needed and
relative times are preferred) but makes all others next to impossible.

(Nitpicking note: in fact the term "absolute time" above is not 100%
correct, as this time is still relative to collection start time, but this
is not an issue as collection time is known when messages are being

So, the questions are:
1. Are there any XEP-136 server-side implementations that implement 4.6
item according to the spec? mod_archive_odbc and mod_archive2 are certainly
not in this group.
2. (probably depending on answers to the first question) How feasible is
it to fix 4.6 to specify absolute times (relative to collection start


Good luck!                                     Alexander

More information about the Standards mailing list