Ok so I confirm the regression is due to XWIKI-21209 and specifically to that line: https://github.com/xwiki/xwiki-platform/commit/33fdaa2345b4d19f1b5b03e5b008a9612688dbd1#diff-195d27544e40a7835c7757068ab104809d712c2e2d3165589635387918290d39R283. And also XWIKI-17243 might probably prevent to hit it. The reason of the regression is that we use to call both `NotificationFilterPreferenceProvider` (`UserProfileNotificationFilterPreferenceProvider` and `WatchlistNotificationFilterPreferenceProvider`), the first one then calling `NotificationFilterPreferenceStore` which was loading all filter preferences of the user, trying to find the one with same id, which obviously couldn't find so returning null and delete performing a check on null to just return, and then only `WatchlistNotificationFilterPreferenceProvider` could be called to perform the deletion. Obviously it was really bad in terms of perf. The problem is that now if the ID is not good for the NotificationFilterPreferenceStore we immediately throw an exception, so we never enter in the other preference provider... I need to check how to nicely fix that. |