Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-14828

updateLastSync sets returnByDefault relationship to empty array

    Details

    • Target Version/s:
    • Story Points:
      3
    • Support Ticket IDs:
    • Zendesk ID:
      50019

      Description

      To reproduce this issue:

      1. Set up IDM 6.5.0.x. 

      2. Create managed/group.  Create a bi-directional many to many relationship between managed/group/myusers and managed/user/mygroups.   Set "returnByDefault" to true for managed/user/mygroups.

      3. Create an ldap conector "ds". Create a mapping managedUser_systemDsAccount. Disable implicit sync.

      4. Create a test manged/user "test1", a test managed/group "group1", add the user to managed/group/<group1 uuid>myusers.

      /openidm/managed/user?_queryFilter=userName+eq+'test1' returns mygroups. This is correct.

      {
          "result": [
              {
                  "_id": "95c68e34-b38f-4c49-bbab-50287ca1cfa0",
                  "_rev": "00000000fe879e1a",
                  "userName": "test1",
                  ...
                  "mygroups": [
                      {
                          "_ref": "managed/group/d52e570d-9aec-4488-a3f0-94785a71bfa4",
                          "_refResourceCollection": "managed/group",
                          "_refResourceId": "d52e570d-9aec-4488-a3f0-94785a71bfa4",
                          "_refProperties": {
                              "_id": "b4770299-74a0-4e5a-8e6f-d39dfc84e6bf",
                              "_rev": "00000000774fa62a"
                          }
                      }
                  ]
              }
          ],
          "resultCount": 1,
          "pagedResultsCookie": null,
          "totalPagedResultsPolicy": "NONE",
          "totalPagedResults": -1,
          "remainingPagedResults": -1
      }
      

      5. Enable implicit sync for managedUser_systemDsAccount.

      6. Create a test manged/user "test2", add "test2" to managed/group/<group1 uuid>myusers.

      Querying managed/user endpoint returns empty array for "test2" mygroups.

      /openidm/managed/user?_queryFilter=userName+eq+'test2'
      /openidm/managed/user?_queryFilter=userName+eq+'test2'&_fields=*,mygroups

      {
          "result": [
              {
                  "_id": "a9e48798-42bb-444b-910d-afb21f0d4509",
                  "_rev": "000000009278e80f",
                  "userName": "test2",
                  ...
                  "mygroups": []
              }
          ],
          "resultCount": 1,
          "pagedResultsCookie": null,
          "totalPagedResultsPolicy": "NONE",
          "totalPagedResults": -1,
          "remainingPagedResults": -1
      }
      

      Querying managed/user/<test2 uuid>/mygroups endpoint shows the relationship is there.

      /openidm/managed/user/a9e48798-42bb-444b-910d-afb21f0d4509/mygroups?_queryfilter=true

      {
          "result": [
              {
                  "_id": "5e31a25c-61d6-45c6-b247-487acd0610e4",
                  "_rev": "00000000b173a432",
                  "_ref": "managed/group/d52e570d-9aec-4488-a3f0-94785a71bfa4",
                  "_refResourceCollection": "managed/group",
                  "_refResourceId": "d52e570d-9aec-4488-a3f0-94785a71bfa4",
                  "_refProperties": {
                      "_id": "5e31a25c-61d6-45c6-b247-487acd0610e4",
                      "_rev": "00000000b173a432"
                  }
              }
          ],
          "resultCount": 1,
          "pagedResultsCookie": null,
          "totalPagedResultsPolicy": "NONE",
          "totalPagedResults": -1,
          "remainingPagedResults": -1
      }
      

        Attachments

          Activity

            People

            • Assignee:
              jason Jason Lemay
              Reporter:
              yinyan.cao Yinyan Cao
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: