From e2807b035edf7d5588dbe8359fc6c1e6b9adf178 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 14 Aug 2022 17:28:31 +0200 Subject: mod_mam: Store archives with sub-second precision timestamps Changes sub-second part of example timestamp to .5 in order to avoid floating point issues. Some clients use timestamps when ordering messages which can lead to messages having the same timestamp ending up in the wrong order. It would be better to preserve the order messages are sent in, which is the order they were stored in. --- spec/scansion/mam_extended.scs | 12 ++++++------ spec/scansion/prosody.cfg.lua | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'spec/scansion') diff --git a/spec/scansion/mam_extended.scs b/spec/scansion/mam_extended.scs index 2c6840df..70897737 100644 --- a/spec/scansion/mam_extended.scs +++ b/spec/scansion/mam_extended.scs @@ -45,8 +45,8 @@ Romeo sends: Romeo receives: - - + + @@ -59,7 +59,7 @@ Romeo receives: - + Hello @@ -71,7 +71,7 @@ Romeo receives: - + U there? @@ -98,7 +98,7 @@ Romeo receives: - + U there? @@ -110,7 +110,7 @@ Romeo receives: - + Hello diff --git a/spec/scansion/prosody.cfg.lua b/spec/scansion/prosody.cfg.lua index 6901cc11..0779f883 100644 --- a/spec/scansion/prosody.cfg.lua +++ b/spec/scansion/prosody.cfg.lua @@ -6,8 +6,8 @@ function _G.os.time() end package.preload["util.time"] = function () return { - now = function () return 1219439344.1; end; - monotonic = function () return 0.1; end; + now = function () return 1219439344.5; end; + monotonic = function () return 0.5; end; } end -- cgit v1.2.3