dazinator / Dotnettency

Mutlitenancy for dotnet applications
MIT License
111 stars 23 forks source link

Fixed faulty equality comparison in TenantShellResolver #25

Closed vzwick closed 7 years ago

vzwick commented 7 years ago

item == identifier would always evaluate to false because of reference comparison, leading to distinguisherFound always being false.

As a result, the identifier would always get added to tenantResult.Distinguishers, even when already part of tenantResult.Distinguishers.

Using item.Equals(identifier) works as intended, overloading the == operator of TenantIdentifier might be worth looking into to prevent regressions of the same sort.

Also, an unnecessary cache update was performed on line 67 (now 68) if identifier and item were identical.

dazinator commented 7 years ago

Good spot, thanks for the PR.

dazinator commented 7 years ago

This has been cherry-picked as a hotfix and merged into master and develop. Thanks for the PR.