Details
-
Bug
-
Resolution: Fixed
-
Major
-
14.6-rc-1
-
None
-
Unit
-
Unknown
-
N/A
-
N/A
-
Description
Steps to reproduce
- Create a page containing {{{ notifications useUserPreferences="true" / }}}
- View that page as guest (or as a user who has no notification preference enabled)
Expected
The macro displays no notification.
Actual
The asynchronous rendering of the notifications fails, and the following error is logged:
ERROR o.x.r.a.i.AsyncRendererJob - Exception thrown during job execution org.xwiki.rendering.RenderingException: Error while retrieving the notification at org.xwiki.notifications.notifiers.internal.DefaultAsyncNotificationRenderer.render(DefaultAsyncNotificationRenderer.java:125) ... Caused by: org.xwiki.notifications.NotificationException: Fail to get the list of notifications. at org.xwiki.notifications.sources.internal.DefaultParametrizedNotificationManager.getRawEvents(DefaultParametrizedNotificationManager.java:159) ... Caused by: org.xwiki.eventstream.EventStreamException: Unsupported block node [null] at org.xwiki.notifications.sources.internal.ExpressionNodeToEventQueryConverter.parseBlock(ExpressionNodeToEventQueryConverter.java:121) at org.xwiki.notifications.sources.internal.ExpressionNodeToEventQueryConverter.parse(ExpressionNodeToEventQueryConverter.java:107) at org.xwiki.notifications.sources.internal.EventQueryGenerator.generateQuery(EventQueryGenerator.java:55) at org.xwiki.notifications.sources.internal.EventSearcher.searchStoreEvents(EventSearcher.java:91) at org.xwiki.notifications.sources.internal.EventSearcher.searchEvents(EventSearcher.java:74)
Analysis
QueryExpressionGenerator#generateQueryExpression returns null when the notification parameters have no preference (which is the case for the guest user with useUserPreferences=true, since no preference can be loaded without a user), meaning that no event can match. EventQueryGenerator#generateQuery passes this null expression to ExpressionNodeToEventQueryConverter#parse, which throws.
Before XWIKI-19826 the exception of the event store was caught and the search fell back on the legacy event stream, which returned an empty list for a null query. Since the fallback was removed, the case is not handled anymore.
Found in the logs of NotificationsIT#compositeNotifications on CI (the test ends on a page with the notifications macro using the user preferences, and its tear down removes the users).
Attachments
Issue Links
- relates to
-
XWIKI-25165 "Load older notifications" skips the notifications that are in the same second as the last displayed one
-
- Closed
-
-
XWIKI-19826 Move the old event store to legacy
-
- Closed
-