File system events are subscribed to even when live_updates is false
spiderbites opened this issue · comments
Describe the bug
Using lookbook 2.0.0.beta.9 an INotify::Watcher
object (via listen
) is initialized for all preview_watch_paths
and page_watch_paths
even when live_updates
is false and reload_on_change
is false.
When testing an upgrade to Lookbook 2 this caused our decently large app to fail to boot due to a Listen::Error::INotifyMaxWatchesExceeded
error.
To Reproduce
Set live_updates
and reload_on_change
to false and note that this code still runs: https://github.com/ViewComponent/lookbook/blob/aab10ad81a0d6bfcdff76408d0e23eadf74ac660/lib/lookbook/support/evented_file_update_checker.rb#L11
Expected behavior
I would not expect these watchers to be subscribing to file changes since. with this config, they will be ignored.
Even with just live_updates
set to false, I would not expect to be watching for changes.
Screenshots
n/a
Version numbers
Please complete the following information:
- Lookbook: 2.0.0.beta.9
- ViewComponent: 2.82.0
- Rails: 7.0.4.3
- Ruby: 3.2.1
Additional context
Thank you! Please let me know if I'm doing any configuration wrong.
Hey @spiderbites, thanks for the bug report, I'll look into this now - sorry it's been causing you headaches! I'm sure your configuration is correct but I'll do some investigating and let you know as soon as I have any updates. Thanks for giving me the heads up on this 👍
Hey @spiderbites this should now be fixed in the latest release that I've just pushed up, so I'm going to close this issue down. If I've missed anything let me know!
Thanks again for alerting me to the issue, much appreciated.
Thanks @allmarkedup! Confirmed this looks good - Lookbook::Engine.reloaders.reloaders
is empty when it should be. Thanks for the quick fix.
@spiderbites great, thanks for letting me know :-)