Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25165

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 12.7-rc-1
    • Notifications
    • None
    • Unknown

    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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: