Notifications without $notificationMessage

In researching the reply from to this thread, I found that the issue that I've been seeing on my site with notifications getting stuck as unread is because they have been removed from the list to display because they don't have a message. Since they aren't displayed, the option for the user to mark them as read also isn't presented.

See Notification List Widget - list.vm (lines 49-51):

	#set ($notificationMessage = false)
	#set ($notificationMessage = $notification.Message('Html'))
	#if ($notificationMessage)

In one instance, once I saw what the targetUrl was for a notification that was "stuck", I realized I was on the page at the time as the reply was posted so I'm guessing that either the original post or the reply that had generated the notification got marked, but not the other and somehow the message was removed from a notification.

Before I add some clean up code to catch notifications that don't have a message and automatically mark them as read, are there any valid notifications without messages that should be left as unread?

  • Can you get the NotificationTypeId from the notifications without messages? None of the out-of-the-box types should have blank messages. You can also check the database to see if there is a message that isn't being rendered.

  • e3df1b21-ac81-4eb3-8ab6-69dc049f5684 is the type that does not have a message. It is the same type that does have a message when showing from forum subscriptions.

    If I comment the #if statement and corresponding #end, then the message field displays as "False"

  • That's ForumReplyNotificationType. The False comes from being set as false (line 1 in your snippet above) and then the Message() method returning null. A common cause of this would be the notification type being disabled in Administration. Another possibility is missing language resources for that plugin, especially if you have additional language translations installed on your site. The notification usually renders using one of the "short_[...]" or "html_[...]" resources

  • Notification type is not disabled and there are not any additional language translations installed. It is not every ForumReplyNotificationType message that returns null and not even the same notification for every user that returns null.

    Is there any reason that it would have a short_ vs html_? Should I adjust to check for short_ instead?

  • The short variations are only used when the target specified is "ShortText", so it wouldn't apply for your snippet. 

    Is there any pattern to which replys are null? Any certain content, quote usage, etc? Is there any possibility that the job server and web site are not configured the same in terms of file storage, etc? it's difficult to assess what may be wrong without a more consistent manner of reproducing the issue.

  • I agree that it is hard to assess what is wrong. It has been very intermittent. Until I discovered the null message, I wasn't even able to identify what the stuck notifications were.

    The notification content that is null differs by user where one user might get a null message for a notification where another user will get the full message. That tends to rule out the content posted being a contributing factor. This issue has been going on since 9.2 so I don't think it is 10.1 specific though it has been more frequently reported since the upgrade (I think this is due to more awareness of change).

    I don't think there are any discrepancies between job server and website in terms of file storage as I feel that would lead to a case of either all of the messages for a notification returning null or be more consistent as to which ones were at issue.

    The only anecdotal evidence I have for a possible correlation is that the user who has a notification with a null message may have been on the page viewing an older copy when the reply was posted.

    Knowing that there is not a time where the message should ever be null in the case of ForumReplyNotificationType, I'll just add an #ElseIf statement to the the end of the null check #If statement to catch and mark as read any notifications that aren't supposed to be null so the user doesn't see a bubble without a message.

  • Just to note that we're getting complaints from our users about a similar issue. I've posted in the other thread mentioned by starksk.

  • That's useful, thanks, we'll work on an upgrade.