Reading Tenant ETS resources returns empty array
I am trying to read a tenanted ets resource but always getting empty list when trying to read, though creates are "successful".
Below is my IEX session
5 Replies
I can see the tenant table created and can get the data out with
tab2list
, so issue looks to be on the read path
As far as I can tell the tenant
is nil on the read path, so it doesn't look in the right table. This is for attribute multitenancy, not sure about context.Oh interesting
You’re using attribute multitenancy?
Ets shouldn’t be making a special table for that, which is what I think the issue is.
Yep attribute multi-tenancy
For ETS, it seems like the implementation details don't really matter like they do for postgres, so maybe it's enough to make sure the
tenant
field in the map isn't nil
? Theres some add_tenant functions which only trigger for :contextCan you open an issue in ash to remind me of this? I have a fix locally I think but have not yet verified. Will push up when I get a chance this evening or tomorrow.
No problem! https://github.com/ash-project/ash/issues/567
GitHub
bug: Reading tenant resources fails with attribute multi-tenancy · ...
Describe the bug Presently, storing a resource with attribute tenancy for ETS happens by creating an ETS table for each tenant <> resource combo. When reading it back, tenant is not set, whic...