Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-15063

If 2 users save their preferences at the same time, the results are unpredictable

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 9.11.3, 10.2
    • 9.11.2, 10.1
    • Notifications
    • None
    • Unknown
    • N/A
    • N/A

    Description

      The problem comes from https://github.com/xwiki/xwiki-platform/blob/68d16b2ce15aaab838da4d69b4f9cd8f0407316c/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-preferences/xwiki-platform-notifications-preferences-api/src/main/java/org/xwiki/notifications/preferences/script/NotificationPreferenceScriptService.java#L103

      A TargetableNotificationPreferenceBuilder is used to create NotificationPreference objects before the saving operation. However, this component is a singleton, and not thread safe!

      A quick fix could be to create an instance of this builder at each request. But I really doubt we need this builder anyway.

      Attachments

        Activity

          People

            gdelhumeau Guillaume Delhumeau
            gdelhumeau Guillaume Delhumeau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: