This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-45e5dcce-17dc-4fb1-8bd4-540af7ad96b9 XWIKI-25165 Open

"Load older notifications" skips the notifications that are in the same second as the last displayed one

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-0f9da7cc-7ce5-43b8-a238-274a15d10b9b Vincent Massol created this issue on 02/Oct/26 21:36
 
Summary: "Load older notifications" skips the notifications that are in the same second as the last displayed one
Issue Type: cid:jira-generated-image-avatar-45e5dcce-17dc-4fb1-8bd4-540af7ad96b9 Bug
Affects Versions: 12.7-rc-1
Assignee: Unassigned
Components: Notifications
Created: 02/Oct/26 21:36
Priority: cid:jira-generated-image-static-major-2e907fe0-3e28-4fad-b690-46445493bce5 Major
Reporter: Vincent Massol
Description:

Steps to reproduce

  1. As user U2, watch the whole wiki and enable the notifications for page creations.
  2. As user U1, create 11 or more pages quickly, so that several of them are saved within the same second (scripts, imports and REST clients easily do this).
  3. As U2, open the notifications menu and click "Load older notifications" until the button disappears.

Expected

Every notification is listed once.

Actual

Notifications are missing: those whose event is in the same second as the last notification displayed before the click are never loaded, neither in the notifications menu nor in a notifications macro (Dashboard activity, user profile, page holding the macro).

Cause

  • "Load older notifications" requests the events strictly older than the date of the last displayed notification: the macro script sends untilDate with untilDateIncluded=false (since XWIKI-17638, which made the bound exclusive to stop the first older notification from being duplicated), and QueryExpressionGenerator#handleEndDate turns it into a strict date < untilDate.
  • The date of a document event is the document date, which has no milliseconds. So any not yet displayed event in that same second is excluded.
  • The blackList parameter, which is sent with the same request and holds the ids of the events already displayed, is enough to avoid the duplicate of XWIKI-17638 with an inclusive bound.

Found while automating the "Load older notifications" manual test (XWIKI-25119): NotificationsIT#simpleNotifications has to wait 1 second before creating the pages whose notifications end a batch, otherwise the test fails randomly.