Open nimir opened 8 years ago
Cause: Debugging #12 seems when the client-side middleware is chained in server, Apartment::Tenant.current is set to base tenant overriding the correct current_tenant stored in item['apartment'].
Apartment::Tenant.current
base
item['apartment']
Chaining client-side in both places is mentioned in Sidekiq docs https://github.com/mperham/sidekiq/wiki/Middleware#sometimes-client-side-middleware-should-be-registered-in-both-places but not sure why it's breaking things now in rails 5.
Fix: Removing the server chain fixes this for me [rails5, mysql, using schema=true]
P.S Not sure if this has some other side effects and it will require more testing.
@nimi - Any word on why this hasn't been pushed in almost three years?
@ACPK due to conflicts :P
Cause: Debugging #12 seems when the client-side middleware is chained in server,
Apartment::Tenant.current
is set tobase
tenant overriding the correct current_tenant stored initem['apartment']
.Chaining client-side in both places is mentioned in Sidekiq docs https://github.com/mperham/sidekiq/wiki/Middleware#sometimes-client-side-middleware-should-be-registered-in-both-places but not sure why it's breaking things now in rails 5.
Fix: Removing the server chain fixes this for me [rails5, mysql, using schema=true]
P.S Not sure if this has some other side effects and it will require more testing.