Done
Details
Assignee
Pavlo SmahinPavlo SmahinReporter
md331md331(Deactivated)Labels
Priority
P3Story Points
2Sprint
NoneDevelopment Team
SpitfireFix versions
TestRail: Cases
Open TestRail: CasesTestRail: Runs
Open TestRail: Runs
Details
Details
Assignee
Pavlo Smahin
Pavlo SmahinReporter
md331
md331(Deactivated)Labels
Priority
Story Points
2
Sprint
None
Development Team
Spitfire
Fix versions
TestRail: Cases
Open TestRail: Cases
TestRail: Runs
Open TestRail: Runs
Created January 19, 2021 at 4:57 PM
Updated June 17, 2021 at 7:18 PM
Resolved February 12, 2021 at 1:07 PM
When attempting to import a user without a
requestPreference
, mod-user-import will attempt to DELETE existing request preferences even ifupdateOnlyPresentFields
is set totrue
.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
.