openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.11k stars 718 forks source link

StimulusReflex caching warning #10048

Closed filipefurtad0 closed 1 year ago

filipefurtad0 commented 1 year ago

What we should change and why (this is tech debt)

Were currently seeing this warning, when running the app/specs in the dev/test environment:

Heads up! 🔥

👉 StimulusReflex requires caching to be enabled. Caching allows the session to be modified during ActionCable requests.

To enable caching in development, run:

rails dev:cache

Context

This came up here: https://github.com/openfoodfoundation/openfoodnetwork/issues/7853#issuecomment-1306875605

Impact and timeline

jibees commented 1 year ago

This warning appears because we don't use cache in Dev:

https://github.com/openfoodfoundation/openfoodnetwork/blob/a95bef141faf76fa9eda85d64d89c876c7aff8ba/config/environments/development.rb#L30

If we start the server by setting DEV_CACHING env. variable to true

DEV_CACHING=true bundle exec rails s -p 3000

it's ok ...

jibees commented 1 year ago

So, the next discussion is: should we activate caching in development mode?

I'm not sure which strategy we should use around making caching disabled by default.

@openfoodfoundation/core-devs do you guys have any thoughts?

(https://github.com/stimulusreflex/stimulus_reflex/issues/258)

abdellani commented 1 year ago

@jibees I was checking the discussion. Does this mean that if the cache is off, the SR features will not be available?

jibees commented 1 year ago

I don't think so, because it actually works in dev. env. when caching is off ;)

abdellani commented 1 year ago

@jibees Yes, I confirm. The code from PR referred to in the last comment is updated.

They're just showing a warning now.

I vote for enabling the cache.

binarygit commented 1 year ago

I agree, we should enable caching