Closed simon1tan closed 2 years ago
Thanks for reporting this bug.
It looks like this code expects a hash in values
, but it's actually a floating point timestamp. I'm still looking to see where that came from.
values.key?(:mtime) ? values : {}
@simon1tan I was able to create a failing test and put in a fix here: https://github.com/guard/listen/pull/552 Look good?
Fixed in v3.7.1.
Renamed a folder and received this error:
{:modified=>[], :added=>[], :removed=>["/mnt/data/services/auto/content/1"]} E, [2021-10-31T18:33:04.468750 #12499] ERROR -- : Exception rescued in listen-run_thread: NoMethodError: undefined method
key?' for 1636153712.0:Float /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/record.rb:58:in
block in dir_entries' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/record.rb:56:intransform_values' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/record.rb:56:in
dir_entries' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/directory.rb:12:inscan' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/change.rb:60:in
invalidate' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/adapter/base.rb:108:in_queue_change' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/adapter/linux.rb:66:in
_process_event' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/adapter/base.rb:44:inblock (2 levels) in configure' /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:217:in
block in watch' /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/watcher.rb:41:incallback!' /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/event.rb:128:in
callback!' /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:264:inblock in process' /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:263:in
each' /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:263:inprocess' /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:236:in
block in run' /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:232:insynchronize' /var/lib/gems/2.7.0/gems/rb-inotify-0.10.1/lib/rb-inotify/notifier.rb:232:in
run' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/adapter/linux.rb:38:in_run' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/adapter/base.rb:79:in
block in start' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/thread.rb:26:inrescue_and_log' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/thread.rb:18:in
block in new' --- Thread.new --- /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/adapter/base.rb:75:instart' /usr/lib/ruby/2.7.0/forwardable.rb:235:in
start' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/listener.rb:71:inblock in <class:Listener>' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/fsm.rb:124:in
instance_eval' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/fsm.rb:124:incall' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/fsm.rb:105:in
transition_with_callbacks!' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/fsm.rb:72:intransition' /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/listener.rb:92:in
start'Code is basically the same as example except Listen.to(ARGV[0])