View Issue Details

IDProjectCategoryView StatusLast Update
0005952unrealircdpublic2023-05-28 11:10
Reporterprogval Assigned Tosyzop  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Fixed in Version6.1.1-rc1 
Summary0005952: CHATHISTORY BETWEEN does not apply bounds the same way depending on order
DescriptionHi,

Given two timestamps (timestamp1 < timestamp2), these two commands:

* CHATHISTORY BETWEEN #channel timestamp=<timestamp1> timestamp=<timestamp2>
* CHATHISTORY BETWEEN #channel timestamp=<timestamp2> timestamp=<timestamp1>

do not return the same results; the latter also returns messages whose timestamp is equal to timestamp1
Steps To Reproducesend messages:

S -> C: @msgid=2Rw7IBLS3NPvHwWaXW5zpo;time=2021-07-04T10:37:08.025Z :bar!~username@Clk-4D552FD5 PRIVMSG ##chan :this is message 0
C -> S: PRIVMSG ##chan :this is message 1
S -> C: @msgid=aYJ2I1m5PQ44w94LkqZRjZ;time=2021-07-04T10:37:08.028Z :bar!~username@Clk-4D552FD5 PRIVMSG ##chan :this is message 1
C -> S: PRIVMSG ##chan :this is message 2
S -> C: @msgid=OtI3mgnEX9cvnFNN1HApm4;time=2021-07-04T10:37:08.032Z :bar!~username@Clk-4D552FD5 PRIVMSG ##chan :this is message 2
C -> S: PRIVMSG ##chan :this is message 3
S -> C: @msgid=iC952TNKSra4djQbVqffRk;time=2021-07-04T10:37:08.035Z :bar!~username@Clk-4D552FD5 PRIVMSG ##chan :this is message 3
C -> S: PRIVMSG ##chan :this is message 4
S -> C: @msgid=FOfbxJacqbfdZ3nPdS9CuT;time=2021-07-04T10:37:08.037Z :bar!~username@Clk-4D552FD5 PRIVMSG ##chan :this is message 4

get messages forward:

C -> S: CHATHISTORY BETWEEN ##chan timestamp=2021-07-04T10:37:08.025Z timestamp=2021-07-04T10:37:08.037Z 10
S -> C: :My.Little.Server BATCH +2KZ8YggHOvz2nk0Y1f9LaJ chathistory ##chan
S -> C: @batch=2KZ8YggHOvz2nk0Y1f9LaJ;msgid=aYJ2I1m5PQ44w94LkqZRjZ;time=2021-07-04T10:37:08.028Z :bar!~username@Clk-4D552FD5 PRIVMSG ##chan :this is message 1
S -> C: @batch=2KZ8YggHOvz2nk0Y1f9LaJ;msgid=OtI3mgnEX9cvnFNN1HApm4;time=2021-07-04T10:37:08.032Z :bar!~username@Clk-4D552FD5 PRIVMSG ##chan :this is message 2
S -> C: @batch=2KZ8YggHOvz2nk0Y1f9LaJ;msgid=iC952TNKSra4djQbVqffRk;time=2021-07-04T10:37:08.035Z :bar!~username@Clk-4D552FD5 PRIVMSG ##chan :this is message 3
S -> C: :My.Little.Server BATCH -2KZ8YggHOvz2nk0Y1f9LaJ

get messages "backward":

C -> S: CHATHISTORY BETWEEN ##chan timestamp=2021-07-04T10:37:08.037Z timestamp=2021-07-04T10:37:08.025Z 10
S -> C: :My.Little.Server BATCH +QMkF76iTAGmlVuKAKj5qt7 chathistory ##chan
S -> C: @batch=QMkF76iTAGmlVuKAKj5qt7;msgid=2Rw7IBLS3NPvHwWaXW5zpo;time=2021-07-04T10:37:08.025Z :bar!~username@Clk-4D552FD5 PRIVMSG ##chan :this is message 0
S -> C: @batch=QMkF76iTAGmlVuKAKj5qt7;msgid=aYJ2I1m5PQ44w94LkqZRjZ;time=2021-07-04T10:37:08.028Z :bar!~username@Clk-4D552FD5 PRIVMSG ##chan :this is message 1
S -> C: @batch=QMkF76iTAGmlVuKAKj5qt7;msgid=OtI3mgnEX9cvnFNN1HApm4;time=2021-07-04T10:37:08.032Z :bar!~username@Clk-4D552FD5 PRIVMSG ##chan :this is message 2
S -> C: @batch=QMkF76iTAGmlVuKAKj5qt7;msgid=iC952TNKSra4djQbVqffRk;time=2021-07-04T10:37:08.035Z :bar!~username@Clk-4D552FD5 PRIVMSG ##chan :this is message 3
S -> C: :My.Little.Server BATCH -QMkF76iTAGmlVuKAKj5qt7
Additional InformationIMO the forward one (excluding both bounds) is implicitly the one recommended by the spec in the way it defines the limit ("With respect to the limit, the returned messages MUST be counted starting from and excluding the first message selector, while finishing on and excluding the second.")

It's also what Ergo does.
Tagsircv3
3rd party modules

Activities

syzop

2023-05-28 11:10

administrator   ~0022888

For this too, thanks for reporting and your patience. Should be fixed now.. and we have a bunch of CHATHISTORY tests in our build tests.

https://github.com/unrealircd/unrealircd/commit/5e64991296f081b2b30ce4d85171a21844c010ff

commit 5e64991296f081b2b30ce4d85171a21844c010ff
Author: Bram Matthys <[email protected]>
Date: Sun May 28 11:07:10 2023 +0200

    Fix CHATHISTORY BETWEEN accidentally including a message too much
    Reported by progval in https://bugs.unrealircd.org/view.php?id=5952

Issue History

Date Modified Username Field Change
2021-07-04 12:41 progval New Issue
2021-07-04 12:41 progval Tag Attached: ircv3
2021-07-04 14:05 syzop Assigned To => syzop
2021-07-04 14:05 syzop Status new => confirmed
2023-05-28 11:10 syzop Status confirmed => resolved
2023-05-28 11:10 syzop Resolution open => fixed
2023-05-28 11:10 syzop Fixed in Version => 6.1.1-rc1
2023-05-28 11:10 syzop Note Added: 0022888