Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-77113

It’s possible to create content properties with duplicate keys via REST API

XMLWordPrintable

      Issue Summary

      When calling the /wiki/rest/api/content/{content-id}/property endpoint with the same request body, it's possible to create content properties with duplicate keys via both v1 and v2 APIs. This seems to be a race condition between the two calls, but we also saw sites on which the two properties were created a few minutes apart.

      This may cause issues when trying to read and update the property, which affects apps that rely on that functionality.

      Steps to Reproduce

      1. Trigger two POST curl calls in the same command using the same body
      2. Two properties will be created with the same key.

      Expected Results

      Only one property is created and the second call is rejected since a property already exists

      Actual Results

      The properties are created with the same key

      Workaround

      All GET v2 REST APIs from Content Properties and Space Properties groups, that return a list of properties, have been updated to remove duplicates automatically. If these APIs find duplicates, they will keep only the most recently created content property, based on their creation date.

      If, for whatever reason, duplicates are needed in the response, a special undocumented showDuplicates request parameter has been added to all these APIs. If this parameter is set to true, APIs will return unfiltered results with duplicates.

              rtalusan Ryan Talusan
              6b8f2fe36dd5 Gabriel Dias
              Votes:
              4 Vote for this issue
              Watchers:
              13 Start watching this issue

                Created:
                Updated: