0

We're using Wisper and somehow one of our event is not registered. Here's our setup:

# event is defined
#
class SomeListener < BaseListener   
  # A working event 
  listen_to :bar_updated do |id|
    ...
  end

  # A buggy event
  listen_to :foo_updated do |id|
    ...
  end
end

# globally subscribed listener
#
Rails.application.config.to_prepare do
  Wisper.subscribe(SomeListener, async: true)
end

# but
#
SomeListener.foo_updated(1)
# => NoMethodError: undefined method `foo_updated' for SomeListener:Class

# whereas other events work
#
SomeListener.bar_updated(1)
# 2022-11-25 16:17:51.240090 D [85591:114160 log_subscriber.rb:126] ActiveRecord::Base ...
# => nil

Any idea how it could happen ?

We've triple checked our files, looks like there's no obvious reason (like method merged into the one above, failed rebased, ...)

Sumak
  • 927
  • 7
  • 21
  • `listen_to` isn't part of wisper, what does that method look like, that is most likely the issue, maybe it isn't creating a class method? If you define a class method `def self.foo_updated(id)` does it work? – Kris Dec 05 '22 at 10:07

0 Answers0