Uploaded image for project: 'mod-user-import'
  1. mod-user-import
  2. MODUIMP-42

Request Preferences are erroneously being deleted

    XMLWordPrintable

Details

    • eHoldings Sprint 107
    • 2
    • Spitfire

    Description

      When attempting to import a user without a requestPreference, mod-user-import will attempt to DELETE existing request preferences even if updateOnlyPresentFields is set to true.

      To replicate:
      1. Create a user manually with preferences so that the request preferences entry is created.
      2. Fire off an import containing info about that user. Eg,

      {
          "users": [
              {
                  "username": "md331@duke.edu",
                  "externalSystemId": "12345",
                  "active": true,
                  "patronGroup": "Staff"
              }
          ],
          "deactivateMissingUsers": false,
          "totalRecords": 1,
          "updateOnlyPresentFields": true
      }
      

      3. Note the response contains a failedUsers entry. Eg,

              {
                  "username": "md331@duke.edu",
                  "externalSystemId": "12345",
                  "errorMessage": "Failed to delete user preference.Failed to decode:Cannot construct instance of `java.util.LinkedHashMap` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('159c0f18-85ba-417e-a705-7306adc6416d')\n at [Source: (String)\"\"159c0f18-85ba-417e-a705-7306adc6416d\"\"; line: 1, column: 1]"
              }
      

      Now, obviously there shouldn't be an error if we are trying to delete the request preference. That's bug #1. But bug #2 is that the code should definitely not unconditionally attempt to delete the request preference if it's nullish, as it does here. It should be checking the value of updateOnlyPresentFields.

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                psmagin Pavlo Smahin
                md331 Mark Deutsch
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases