SimpleIdServer icon indicating copy to clipboard operation
SimpleIdServer copied to clipboard

Exception on delete user

Open yoavyanuka opened this issue 2 years ago • 3 comments

Hello,

I get this error when trying to delete a user

System.ArgumentException: Can not add property value to Newtonsoft.Json.Linq.JObject. Property with the same name already exists on object.

What am I doing:

  • created a new user
  • created a new group
  • added the user to the group
  • removed the user then I get the exception Interesting part is I don't get this error on my local machine just with my production db debugged it a little bit looks like the error happens in SCIMRepresentationExtensions. EnrichResponse when calling case SCIMSchemaAttributeTypes.STRING: the firstRecord.AttributeNode.SchemaAttribute.Name is equal to value and the value already exists. seems like the first value that was entered was an email and the second one is the group id I would think they need to go under the groups and emails arrays but they don't

any help would be appriciated

KR

Yoav

yoavyanuka avatar Oct 31 '23 14:10 yoavyanuka

Hello,

Indeed there is a bug in the implementation & I could reproduce it on my local machine. The issue will be fixed tomorrow (01/11) on the branch release/4.0.5.

KR,

SID

simpleidserver avatar Oct 31 '23 22:10 simpleidserver

Thank you.

KR,

Yoav

yoavyanuka avatar Nov 01 '23 07:11 yoavyanuka

The issue has been resolved in the release/4.0.5 branch.

An issue was identified in the DeleteRepresentationCommandHandler class. When the DbContext was saved, the ParentAttributeId property of all representation attributes was set to NULL. As a result, it became impossible to construct the hierarchical result because this property is used during the construction process.

Now, a clone of the representation is returned, and this new object is not affected by the change tracker of Entity Framework :)

simpleidserver avatar Nov 01 '23 20:11 simpleidserver