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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 9.11.2, 10.1
    • Fix Version/s: 9.11.3, 10.2
    • Component/s: Notifications
    • Labels:
      None
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      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

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

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: