Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after_stripe_event! not called after code reload #219

Open
heaven opened this issue Jul 4, 2022 · 4 comments
Open

after_stripe_event! not called after code reload #219

heaven opened this issue Jul 4, 2022 · 4 comments

Comments

@heaven
Copy link

heaven commented Jul 4, 2022

include Stripe::Callbacks

after_stripe_event! do |target, event|
  Billing::Event.create!(stripe_id: event.id, kind: event.type, data: event.to_hash)
end

The code above works well after the app restart. Once I modify the code the app gets reloaded and the callback is never called again.

Can reproduce from rails console

3.1.1 :002 > ::Stripe::Callbacks::critical_callbacks
 => {"stripe.event"=>[#<Proc:0x00000001163479b8 /Users/heaven/Workspace/mdc/app/models/member.rb:30>]}
3.1.1 :003 > reload!
Reloading...
 => true
3.1.1 :004 > ::Stripe::Callbacks::critical_callbacks
 => {}

To reproduce the problem config.eager_load should be true in development.

Rails: 7.0.2
Rails env: development
Stripe: 6.5.0 (same with 6.1.0)
Stripe Rails: 2.3.4

@kbrgl
Copy link

kbrgl commented Jul 11, 2022

Same issue here. I was going crazy trying to figure out why the callbacks aren't showing up. Probably going to switch back to the basic Stripe gem until this is fixed.

@heaven
Copy link
Author

heaven commented Jul 17, 2022

This is a quite serious issue and breaks the development process completely. Can anyone have a look, please? All versions starting from 2.0.0 are affected.

@tansengming
Copy link
Owner

Hi folks, I'm currently busy with work right now and won't have time to look at this for at least a few more weeks. If you'd like to take a stab at this, I'll be happy to look at your PR!

Here are some past work on this that might point to why it's broken right now,

@XORwell
Copy link

XORwell commented Aug 28, 2022

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants