JudahGabriel / RavenDB.Identity

RavenDB Identity provider for ASP.NET Core. Let RavenDB manage your users and logins.
https://www.nuget.org/packages/RavenDB.Identity/1.0.0
MIT License
61 stars 29 forks source link

Fix role losing users and claims when retrieved from database #41

Closed wagich closed 3 years ago

wagich commented 3 years ago

This PR adds private setters to the Users and Claims properties on IdentityRole.

Without these setters RavenDb can't deserialize the role correctly, leaving both the users and claims collections empty. This change then gets picked up by change tracking and on the next (maybe unrelated) call to SaveChanges the info in the DB gets wiped out.

JudahGabriel commented 3 years ago

Hey @wagich - is this unrelated to your previous PR #39 ?

wagich commented 3 years ago

@JudahGabriel It fixes another bug that I found regarding role usage, but it is not strictly related since this concerns the role class itself…

I was thinking it would be better to be very granular with the fixes, so I separated it. If you prefer, I can roll it into the other one.

JudahGabriel commented 3 years ago

I've deployed your fix to RavenDB.Identity 8.0.7. 👍