question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tenant used as key problem

See original GitHub issue

The TTenant is being used as the key to the concurrent dictionary here: https://github.com/saaskit/saaskit/blob/master/src/SaasKit.Multitenancy/Internal/TenantPipelineMiddleware.cs#L15

However, when the TenantContext is disposed (memory cache invalidation) the TTenant instance is disposed. However it’s still left as the key in the concurrent dictionary… Unclear if that will cause problems, but I am raising it as it seems undesirable?

Also there aren’t any constraints that I can see, that make it obvious to implementers of TTenant that they need to support being used a dictionary key. (implement GetHashCode, Equals etc))

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
tilligcommented, Sep 6, 2017

…but now I’m seeing #68 and wondering if what I’m doing is such a good idea in light of the auto-disposal of properties. Could be a huge gotcha later. Hmmm. May need to fork.

1reaction
tilligcommented, Sep 6, 2017

I ended up using a string as my TTenant and put all the actual tenant config/settings into properties on TenantContext.

Read more comments on GitHub >

github_iconTop Results From Across the Web

My tenant is against me having the keys to her house. ...
My tenants have never had issues with me having the keys but there had been at least once where the tenants changed the...
Read more >
How to handle tenants' lost keys and related security issues
First, be sure to collect a deposit from each tenant when he/she signs the lease in an amount that would cover the cost...
Read more >
10 Things Landlords Need to Know About Keys
7. Prohibit tenants from duplicating keys to reduce the risk. Using keys marked “Do Not Duplicate” will prevent reputable locksmiths or key ...
Read more >
4 Things Landlords Are Not Allowed to Do
Although a landlord may own a rental property, tenants have unique protections from discrimination, harassment, arbitrary rent increases, and wrongful eviction.
Read more >
Can My Landlord Charge for Spare Keys?
Is it legal to charge tenants for the use of keys that they provided to the landlord? A: Landlords keep tenants' keys for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found