Open samstickland opened 3 years ago
As example, this was the result of a cache key clash in production!
@samstickland Thanks for reporting this! Created #494 for same but with the difference of using snake case style for naming instead of direct class names.
@yogeshjain999 also found https://github.com/trailblazer/trailblazer-cells/issues/13 which is a the same bug.
@yogeshjain999 Can't we fix this in Trailblazer::Cell
? I think it's a problem there and not in the cells
gem?
If there are two cells in the same namespace the same cache will be produced by default, which of course causes all sorts of problems in production.
In caching.rb we have:
https://github.com/trailblazer/cells/blob/master/lib/cell/caching.rb#L30
And in cell.rb
https://github.com/trailblazer/trailblazer-cells/blob/master/lib/trailblazer/cell.rb#L36
This means that a cells called
SomeNamespace::Cell::One
andSomeNamespace::Cell::Two
will produce the samecontroller_path
and hence the same cache key.I can't see why we simply wouldn't the class name for cache key?
Our workaround for this is currently:
etc.
I think the first code should be: