simpleidserver / SimpleIdServer

OpenID, OAuth 2.0, SCIM2.0, UMA2.0, FAPI, CIBA & OPENBANKING Framework for ASP.NET Core
https://simpleidserver.com/
Apache License 2.0
686 stars 90 forks source link

Exception on delete user #608

Closed yoavyanuka closed 1 month ago

yoavyanuka commented 8 months ago

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:

any help would be appriciated

KR

Yoav

simpleidserver commented 8 months ago

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

yoavyanuka commented 8 months ago

Thank you.

KR,

Yoav

simpleidserver commented 8 months ago

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

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 :)