This issue has been created
There are 2 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-37813eac-3dcd-4f4d-a578-bca242eb9fdb XWIKI-25280 Open

Notifications macro fails with "Unsupported block node [null]" when there is no notification preference

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-b217ca53-ff37-4734-98db-5233c3305265 Simon Urli created this issue on 13/Oct/26 16:04
 
Summary: Notifications macro fails with "Unsupported block node [null]" when there is no notification preference
Issue Type: cid:jira-generated-image-avatar-37813eac-3dcd-4f4d-a578-bca242eb9fdb Bug
Affects Versions: 14.6-rc-1
Assignee: Unassigned
Components: Notifications
Created: 13/Oct/26 16:04
Priority: cid:jira-generated-image-static-major-95483bac-c943-4632-a356-4a0056cf6a96 Major
Reporter: Simon Urli
Description:

Steps to reproduce

  1. Create a page containing {{{ notifications useUserPreferences="true" / }}}
  2. 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).

 
 

2 updates

 
cid:jira-generated-image-avatar-b217ca53-ff37-4734-98db-5233c3305265 Changes by Simon Urli on 13/Oct/26 16:04
 
Fix Version: 18.9.0-rc-1
Assignee: Simon Urli