Clear all notification filters (Velocity?)

Hi,

our whole wiki setup got kinda slow after accessing a profile of a user which somehow got 2800 times his own profile page on the notication filter list. After many hours I managed to delete this user, but I noticed that other users are facing slow notification info because they also have hundreds of filters for their own profile page. I managed to change “Automatic page watching” to never for all of them via velocity macro on the start page, but I fail to delete all filters the same way. Can someone help me with that? Thanks in advance!

Here is what I did to set “Automatic page watching” to never:
{{velocity}}
#set($userdoc=$xwiki.getDocument($xcontext.user))
#set($obj=$userdoc.getObject(“XWiki.Notifications.Code.AutomaticWatchModeClass”))
#set($value=$obj.getProperty(‘automaticWatchMode’).getValue())
#if ($value != ‘NONE’)
$obj.set(‘automaticWatchMode’,‘NONE’)
$userdoc.save()
#end
{{/velocity}}

The Property “spaces” for the class “NotificationFilterPreferenceClass” of my profile page is empty, but i have some filters set…

Hello.

I remember we had a problem with thousands of filters automatically created, but it was fixed while ago. If your wiki was using the Watchlist feature in the past, then a filter is created for every watched page (see: Notifications - Watchlist Bridge Module. That may explain your problem.

So if you want to clear your filters, you need to remove all objects of the class XWiki.Notifications.Code.NotificationFilterPreferenceClass but also the watchlist’s objects: XWiki.WatchListClass.

I hope it helps,

Guillaume