Serge Huber created UNOMI-1030:
----------------------------------
Summary: GraphQL add/remove profile to list is not saved when the
profile is already in a list
Key: UNOMI-1030
URL: https://issues.apache.org/jira/browse/UNOMI-1030
Project: Apache Unomi
Issue Type: Bug
Affects Versions: unomi-4.0.0, unomi-3.0.1
Reporter: Serge Huber
Fix For: unomi-4.0.0
h3. In short
Adding a profile to a list, or removing it from one, through GraphQL silently
does nothing if that profile already belongs to at least one list. The call
succeeds, but the change is never saved.
h3. Details
* {{CDPUpdateListsAction}} edits the profile's existing
{{systemProperties.lists}} object in place, then sends {{updateProperties}}
with that same object.
* {{PropertyHelper.setProperty}} compares the new value with the (already
modified) old one, finds them equal and returns NO\_CHANGE, so
{{AddProfileToListCommand}} / {{RemoveProfileFromListCommand}} never save the
profile (remove also returns false).
* Only profiles with no {{lists}} yet work, which is why {{GraphQLListIT}}
(fresh profile) does not catch it. Found while reviewing PR 939 (UNOMI-1027).
h3. Fix and test
Build a new list (copy of the existing one) in {{CDPUpdateListsAction}} before
adding/removing. Unit test: profile already in list A, join list B →
PROFILE\_UPDATED and saved; same for leave.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)