You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #875, marten#5479, polecat#655 and fisher#309. JasperFx 2.74.0 lifted JasperFx.MultiTenancy.DisabledTenantException (a subclass of UnknownTenantIdException), and Marten 9.39.0, Polecat 5.31.0 and Fisher 1.12.0 now throw it for a tenant that exists but was switched off, so the operator who just ran CritterWatch's disable_tenant no longer reads "Unknown tenant id" about a tenant that is still there.
Wolverine's own two tenant sources did not move, and both know the difference:
Wolverine.EntityFrameworkCore/Internals/ConjoinedTenantSource.cs:86 — if (ConjoinedTenancy.IsTenantDisabled(typeof(T), tenantId)) throw new UnknownTenantIdException(tenantId); and the same check in TenantStampingInterceptor.cs:41. The disabled state is tracked explicitly in ConjoinedTenancy._disabledTenantsByContextType.
Wolverine.RDBMS/MultiTenancy/MasterTenantSource.cs:64 — throws UnknownTenantIdException when the registry returns no connection string. The registry has SetTenantDisabledAsync / LoadDisabledTenantIdsAsync, so the source can tell "no row" from "disabled row" but reports both the same way.
Proposed:
Bump JasperFx to 2.74.0 (Directory.Packages.props is on 2.73.2).
Throw DisabledTenantException at the three sites above when the tenant is known-but-disabled; keep UnknownTenantIdException for a genuinely unregistered id. Because the new type subclasses the old one, every existing catch (UnknownTenantIdException) and OnException<UnknownTenantIdException>() policy keeps working.
Follow-up to #875, marten#5479, polecat#655 and fisher#309. JasperFx 2.74.0 lifted
JasperFx.MultiTenancy.DisabledTenantException(a subclass ofUnknownTenantIdException), and Marten 9.39.0, Polecat 5.31.0 and Fisher 1.12.0 now throw it for a tenant that exists but was switched off, so the operator who just ran CritterWatch'sdisable_tenantno longer reads "Unknown tenant id" about a tenant that is still there.Wolverine's own two tenant sources did not move, and both know the difference:
Wolverine.EntityFrameworkCore/Internals/ConjoinedTenantSource.cs:86—if (ConjoinedTenancy.IsTenantDisabled(typeof(T), tenantId)) throw new UnknownTenantIdException(tenantId);and the same check inTenantStampingInterceptor.cs:41. The disabled state is tracked explicitly inConjoinedTenancy._disabledTenantsByContextType.Wolverine.RDBMS/MultiTenancy/MasterTenantSource.cs:64— throwsUnknownTenantIdExceptionwhen the registry returns no connection string. The registry hasSetTenantDisabledAsync/LoadDisabledTenantIdsAsync, so the source can tell "no row" from "disabled row" but reports both the same way.Proposed:
Directory.Packages.propsis on 2.73.2).DisabledTenantExceptionat the three sites above when the tenant is known-but-disabled; keepUnknownTenantIdExceptionfor a genuinely unregistered id. Because the new type subclasses the old one, every existingcatch (UnknownTenantIdException)andOnException<UnknownTenantIdException>()policy keeps working.MapUnknownTenantToNotFound()(Wolverine.HTTP: map UnknownTenantIdException (and DisabledTenantException once lifted) to 404/403 ProblemDetails alongside the #4512 concurrency mapping #4516) if a disabled tenant should answer differently from an unknown one in HTTP — the Wolverine.HTTP: map UnknownTenantIdException (and DisabledTenantException once lifted) to 404/403 ProblemDetails alongside the #4512 concurrency mapping #4516 issue text mentioned 403 for disabled; today both are 404 through the base type, which may be fine.Found while writing the
critterstack-troubleshooting-multi-tenancyskill in JasperFx/ai-skills (#217), which currently documents this asymmetry.🤖 Generated with Claude Code